-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Microsoft Power BI Cookbook
By :

To implement complex and less common data transformation requirements, it is often necessary to browse the M library to find a specific function or review the parameters of a specific function.
This short recipe provides a pre-built M query expression you can use to retrieve the M library into a table for analysis in Power BI Desktop. Additionally, an example is provided of visualizing and cross-filtering this table of functions on the Power BI report canvas.
To get ready for this recipe, do the following:
To implement this recipe, perform the following steps:
let
Source = Record.ToTable(#shared),
Rename = Table.RenameColumns(Source, {{"Name", "Function"}}),
Sort = Table.Sort(Rename, {{"Function", Order.Ascending}}),
Dupe = Table.DuplicateColumn(Sort, "Function", "Function2"),
Split =
Table.SplitColumn(
Dupe, "Function2",
Splitter.SplitTextByDelimiter(".", QuoteStyle.Csv),
{"Group", "Detail"}
),
MLibraryTable =
Table.TransformColumnTypes(
Split, {{"Group", Text.Type}, {"Detail", Text.Type}}
)
in
MLibraryTable
Figure 2.41: Query Editor view of library table function
Function Groups
column for filtering.Figure 2.42: Report page of M standard library
The M expression leverages the #shared
variable, which returns a record of the names and values currently in scope. The record is converted to a table value and then the Function
column, originally Name
in the context of the library, is split based on the period delimiter to allow for the Group
column.
M library details for every function are made available by entering the function without any parameters.
Figure 2.43: Library Function Details