Item access in M

Accessing records from tables, items from lists, and values from records are fundamental to M query development. In the following example, the results of the BI.vDim_Account SQL view are returned to Power BI using slightly different M syntax than the customer dimension query from the previous section:

let    Source = AdWorksSQLServer,    AccountRecord = Source{[Name = "BI.vDim_Account"]},    Account = AccountRecord[Data]in    Account

For this query, a record is retrieved from the AdWorksSQLServer staging query based only on the Name column. The Data field of this record is then accessed in a separate variable (Account) to return the results of the BI.vDim_Account SQL view to Power BI. BI teams or the dataset designer can decide on a ...

Get Mastering Microsoft Power BI now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.