Power Query M query examples
As demonstrated in the examples thus far, the combination of a mature data warehouse and a layer of SQL view objects within this source may eliminate any need for further data transformations. However, Power BI dataset designers should still be familiar with the fundamentals of M queries and their most common use cases, as it’s often necessary to further extend and enhance source data.
The following sections demonstrate three common data transformation scenarios that can be implemented in M. Beyond retrieving the correct results, the M queries also generate SQL statements for execution by the source system via query folding, and comments are included for longer-term maintenance purposes.
If you’re new to M query development, you can create a blank query from the Other category of data source connectors available within the Get Data dialog.
Alternatively, you can duplicate an existing query via the right-click context menu of...