This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreDid you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now
DAX query view, released in public preview last month, in the December 2023 Power BI Desktop release has exciting updates including the new INFO DAX functions and improvements to the Update model CodeLens.
There are over 50 new INFO DAX functions now available! Those of you who are familiar with the Dynamic Management Views, or DMVs, of models in Power BI, Azure Analysis Services, and SQL Server Analysis Services will recognize these as the TMSCHEMA DMVs. The existing TMSCHEMA DMVs are now available as DAX functions. Providing them as DAX functions gives the following benefits:
| # | Function |
| 1 | INFO.ALTERNATEOFDEFINITIONS |
| 2 | INFO.ANNOTATIONS |
| 3 | INFO.ATTRIBUTEHIERARCHIES |
| 4 | INFO.ATTRIBUTEHIERARCHYSTORAGES |
| 5 | INFO.CALCULATIONGROUPS |
| 6 | INFO.CALCULATIONITEMS |
| 7 | INFO.COLUMNPARTITIONSTORAGES |
| 8 | INFO.COLUMNPERMISSIONS |
| 9 | INFO.COLUMNS |
| 10 | INFO.COLUMNSTORAGES |
| 11 | INFO.CULTURES |
| 12 | INFO.DATACOVERAGEDEFINITIONS |
| 13 | INFO.DATASOURCES |
| 14 | INFO.DELTATABLEMETADATASTORAGES |
| 15 | INFO.DETAILROWSDEFINITIONS |
| 16 | INFO.DICTIONARYSTORAGES |
| 17 | INFO.EXPRESSIONS |
| 18 | INFO.EXTENDEDPROPERTIES |
| 19 | INFO.FORMATSTRINGDEFINITIONS |
| 20 | INFO.GENERALSEGMENTMAPSEGMENTMETADATASTORAGES |
| 21 | INFO.GROUPBYCOLUMNS |
| 22 | INFO.HIERARCHIES |
| 23 | INFO.HIERARCHYSTORAGES |
| 24 | INFO.KPIS |
| 25 | INFO.LEVELS |
| 26 | INFO.MEASURES |
| 27 | INFO.MODEL |
| 28 | INFO.OBJECTTRANSLATIONS |
| 29 | INFO.PARQUETFILESTORAGES |
| 30 | INFO.PARTITIONS |
| 31 | INFO.PARTITIONSTORAGES |
| 32 | INFO.PERSPECTIVECOLUMNS |
| 33 | INFO.PERSPECTIVEHIERARCHIES |
| 34 | INFO.PERSPECTIVEMEASURES |
| 35 | INFO.PERSPECTIVES |
| 36 | INFO.PERSPECTIVETABLES |
| 37 | INFO.QUERYGROUPS |
| 38 | INFO.REFRESHPOLICIES |
| 39 | INFO.RELATEDCOLUMNDETAILS |
| 40 | INFO.RELATIONSHIPINDEXSTORAGES |
| 41 | INFO.RELATIONSHIPS |
| 42 | INFO.RELATIONSHIPSTORAGES |
| 43 | INFO.ROLEMEMBERSHIPS |
| 44 | INFO.ROLES |
| 45 | INFO.SEGMENTMAPSTORAGES |
| 46 | INFO.SEGMENTSTORAGES |
| 47 | INFO.STORAGEFILES |
| 48 | INFO.STORAGEFOLDERS |
| 49 | INFO.TABLEPERMISSIONS |
| 50 | INFO.TABLES |
| 51 | INFO.TABLESTORAGES |
| 52 | INFO.VARIATIONS |
To follow along, download the Store Sales PBIX from https://learn.microsoft.com/power-bi/create-reports/sample-datasets#updated-samples.
In Power BI Desktop I go to DAX query view and type in EVALUATE followed by INFO to see them all listed.
DAX_query_view_introduces_new_INFO_DAX_functions
I can continue typing or scroll down to INFO.MEASURES. Then I click run, or the popular keyboard shortcut to run queries, F5 (also added in December!). You can also use the maybe lesser-known keyboard shortcut, CTRL+SHIFT+E to run the DAX query.
DAX_query_view_introduces_new_INFO_DAX_functions
Now I can see all the measures in my model, their expression, and other useful information about them. It also gives me their home table but in maybe a slightly less useful TableID column. Thankfully, there is an INFO.TABLES DAX function which has the name of table 10 and 13. To join them, I utilize SELECTCOLUMNS and NATURALLEFTOUTERJOIN shown in the example below.
EVALUATE
VAR _measures =
SELECTCOLUMNS(
INFO.MEASURES(),
"Measure", [Name],
"Desc", [Description],
"DAX formula", [Expression],
"TableID", [TableID]
)
VAR _tables =
SELECTCOLUMNS(
INFO.TABLES(),
"TableID", [ID],
"Table", [Name]
)
VAR _combined =
NATURALLEFTOUTERJOIN(_measures, _tables)
RETURN
SELECTCOLUMNS(
_combined,
"Measure", [Measure],
"Desc", [Desc],
"DAX Formula", [DAX formula],
"Home Table", [Table]
)
DAX_query_view_introduces_new_INFO_DAX_functions
Documenting your model just got a lot easier! Copy the results where you need with the Copy button.
For example, I can go to Model view and choose Enter data to Paste them into the model.
DAX_query_view_introduces_new_INFO_DAX_functions
I can then add a Report page with a visual showing information about this model:
DAX_query_view_introduces_new_INFO_DAX_functions
And here I have pasted them into Excel and made a dynamic table with CTRL+T.
DAX_query_view_introduces_new_INFO_DAX_functions
Copy then paste may not work well if you have DAX formulas on multiple lines in your measures. In that case, you can run the DAX query in Excel directly.
You can do this with any of your DAX queries, not just these new INFO DAX functions.
Another combination that may be useful for the new INFO DAX functions is to explore the columns in your model.
DEFINE
VAR _tables =
SELECTCOLUMNS(
FILTER(
INFO.TABLES(),
// Exclude hidden tables
[IsHidden] = FALSE()
),
"TableID",[ID],
"TableName",[Name]
)
VAR _columns =
FILTER(
INFO.COLUMNS(),
// Exclude RowNumber columns
[Type] <> 3
)
VAR _result =
SELECTCOLUMNS(
NATURALINNERJOIN(
_columns,
_tables
),
"Table",[TableName],
"Column",[ExplicitName],
"Description",[Description],
"Column in Data Source",[SourceColumn],
"Data Category", [DataCategory],
"Column Type",
SWITCH(
[Type],
1,"Data column",
2, "Calculated column",
[Type]
),
"DAX formula", [Expression]
)
EVALUATE
_result
And when I run this DAX query, I can see information about all the columns in my model. I can see if the name is different than the source name, if they have a data category, and even the DAX formula for calculated columns!
DAX_query_view_introduces_new_INFO_DAX_functions
I can take this even further. I am concerned about the number of calculated columns, so I want to see how many there are and then show only calculated columns. I can do this by adding this to my DAX query:
EVALUATE
{COUNTROWS(
FILTER(
_result,
[Column Type] = "Calculated column")
)}
EVALUATE
FILTER(
_result,
[Column Type] = "Calculated column")
Changing the DAX query view result grid to the 2nd result, I can see there are 6 calculated columns:
DAX_query_view_introduces_new_INFO_DAX_functions
And the 3rd result shows me just the calculated columns:
DAX_query_view_introduces_new_INFO_DAX_functions
I wonder what DAX formula for Category (clusters) 2 is. I can hover over it to see the full DAX formula.
DAX_query_view_introduces_new_INFO_DAX_functions
As you can see, there are many new ways to explore the metadata of your model with these INFO DAX functions!
One thing you cannot do with these functions is use them in calculated tables, calculated columns, and measures. They will show an error if you try. So, you should not see them in DAX formula bar IntelliSense. (Edit: the INFO functions will show in the DAX formula bar IntelliSense, but they may result in an error when used). If you use them in the DEFINE MEASURE, DAX query view will currently still show the Update model CodeLens, but it will result in an error when clicked. These measures can still be run as DAX query in DAX query view without error.
Finally, an exciting update to the Update model CodeLens! Now comments are kept when using the CodeLens and the CodeLens will show when the DAX formula formatting has been changed. For example, when you use Quick queries to Evaluate and define a measure, then click Format query. Now those with new formatting will show a CodeLens to Update model to quickly format your measure DAX formulas.
DAX_query_view_introduces_new_INFO_DAX_functions
I hope these examples help you with your semantic models. Try out these exciting changes today and let us know your feedback as we continue the public preview of DAX query view and continue to add functionality.
Next steps:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.