Adding conditional columns
You can also enrich your queries by adding columns with if…then
logic and applying some conditions based on existing columns. These are called conditional columns and this feature allows you to implement conditional expressions with an intuitive interface. In this recipe, you will see how it is easy to apply custom flags based on the values of existing columns.
Getting ready
For this recipe, you need to download the FactInternetSales
CSV file.
In this example, we will refer to the C:\Data
folder.
How to do it…
Once you open your Power BI Desktop application, you are ready to perform the following steps:
- Click on Get data and select the Text/CSV connector.
- Browse to your local folder where you downloaded the
FactInternetSales
CSV file and open it. The following window with a preview of the data will pop up; click on Transform Data: - Browse to the Add Column tab and click on...