Leveraging M – tips and tricks
Using M code and editing existing queries from the Advanced Editor implies paying attention to some general rules in order to avoid common errors. In this recipe, we will discover some tips and tricks to keep in mind when editing queries and using M code on them.
Getting ready
In 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. - Rename the
ProductKey
column toProductKeyCode
: - Click on Choose Columns and flag ProductKeyCode, OrderQuantity, SalesAmount, and OrderDate...