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.

Anonymous

How to get all the DAX expression (Measures)from power bi file with DAX Studio

I was looking for a solution for how can I get all the DAX measures in Excel from Power BI

I haver found multiple articles but nothing was work out for  me

Then I found DAX studio which is provided free in SqlBI Website in DAX Studio

I have found the option from where I can get the this done in just 10 mins.

Below are the steps.

 

Open DAX Studio. select your file

Go to DMV.

PIC 1.jpg

 Click on DMV

Select MDSCHEMA_MEASURES

PIC 2.jpg

Click on this  and then Run 

 

PIC 3.jpg

You will see the table will come in the result.

PIC 4.jpg

Copy this table in the Excel  You can find your solution..

 

PIC 5.jpg

 

 

 

 

Comments

If you export the VPAX file from DAX Studio (Advanced / Export metrics) and import it in VertiPaq Analyzer, you get all the DAX expressions (not just the measures) in a table that you can easily filter, and you can also format them!

I was also going to say the Vertipaq Analyzer is your friend here! What is also cool about it is you can swap out the VPAX files generated from different dates (I create them periodically and save them with their date generated) to find maybe an older measure version you accidently changed.

@marcorusso for premium and AAS people I've tried to create that Expressions table in Power BI directly to have a stand alone Data Dictionary report that keeps itself updated. There is some magic with getting the table, calculated column, and measure expressions combined so nicely. Don't suppose there is an expression that creates that directly available?

 

DataZoe_0-1612888763817.png

I've also done this with non-premium by just opening the PBIX's together and using localhost:xxxxx to connect to update it. 

VertiPaq Analyzer 2.0 performs several tasks to retrieve all the DAX expressions in the model. The source code is available at sql-bi/VertiPaq-Analyzer (github.com)

In short, you cannot retrieve all the information through DMVs only.

 

Marco

Here is an easy way to get the measures from a PBIX.

 

In DAX strudio paster the following SQL in the editor while connected to the PBIX that you want all the measures from.

 

SELECT [name], [expression] from $SYSTEM.TMSCHEMA_MEASURES

 

Click the output button on the toolbar, then click file.  This will export the Measures to a CSV file format.

Thanks man/women (Dude,Dudet), 

saved me a lot of time.