Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Using model's metadata to create table

Hi all

 

One of the things that we thing will make life easier for our users is if we have a report page that says what measures are in the model and gives a brief description. Helpfully, Power BI supports a "description" attribute for each measure, and so the obvious thing to do is simply to query the model's own metadata to produce a table listing all measures and their description. What I can't figure out is how you can do this.

 

Help please!

 

Thanks

Stuart

5 REPLIES 5
v-eqin-msft
Community Support
Community Support

Hi @Anonymous ,

Sorry for my late reply ... You could follow these steps.

1.Use the following Query code in DAX Studio(the pbix file should be run )

SELECT
[Measure_Name] as [Metric],[Measuregroup_Name] as [Table],[Description],[Expression]
from 
$SYSTEM.MDSCHEMA_MEASURES 

ORDER BY [Measure_Name];

2.Clike OutputàFile and Run again, the results will be save as Text file.

9.8.3.1.png

 

3.Then you could get data from the Text file

9.8.3.2.png

 

You could take a look at these two articles for more information.

https://insightsquest.com/2017/12/14/query-power-bi-field-descriptions/

https://exceleratorbi.com.au/getting-started-dax-studio/

 

 

Did I answer your question ? Please mark my reply as solution. Thank you very much.

If not, please upload some insensitive data samples and expected output.

 

Best Regards,

Eyelyn Qin

 

Anonymous
Not applicable

Thanks all for the responses so far, but I've had limited success. @amitchandak  and @Fowmy , your links seem to be designed for a one-off exercise and rely out output files. @MFelix , your link got me further in that I was able to generate a table of measure directly in the Power BI report, but it relied of the PID of the open file, which changes:

 

 

let
    Source = OleDb.Query("Provider=MSOLAP.8;Data Source=localhost:52697;Update Isolation Level=2", "SELECT * FROM $SYSTEM.MDSCHEMA_MEASURES")
in
    Source

 

 

What I erally need is:

  1. a report in the Power BI service (app.powerbi.com)
  2. that is able to generate a table containing measure metadata
  3. which can then be reported to users in the form of a table visualisation.
Fowmy
Super User
Super User

@Anonymous 

One way to achieve this is by going to DAX Studio and run the following script, It will list all the measures in the model Then you can export it to ExcelCsv and proceed.

select * from$SYSTEM.TMSCHEMA_MEASURES

Dax Studio download: https://daxstudio.org/

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn



Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

MFelix
Super User
Super User

Hi @Anonymous ,

 

In the blog post below you have a description of how to identify the not used measures however one of the first steps is to retrieve all the measures in your file.

Read the part Retrieve a list of all measures and you can get the expected result.

 

https://ssbi-blog.de/blog/technical-topics-english/how-to-identify-measures-not-used-in-your-pbix-file/

 

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.