Blogs / Microsoft / Power BI / Exporting Measure and Column formulas from Power BI

Exporting Measure and Column formulas from Power BI

Jul 10, 2019

SHARE

Power BI supports extensive Data Analysis Expressions(DAX) scripting to achieve complex business scenarios. It is a good practice to maintain a document for each report which helps in future development. The Document can include screenshots of Report Pages, Purpose of the Report, Lists of Navigation, Tables and Queries and a complete listing of the DAX formulas.

All this information is easily achievable except for the DAX formulas. Using DAX users can create Measures and Columns in PowerBI.  However, there is no direct option to export the DAX formulas for documentation purposes. This blog will cover exporting the Measure and Column definitions into a CSV file from Power BI.

Steps to export the DAX formulas

1.  Navigate to Model View.

Exporting Measure and Column formulas from Power BI

2. Click File Menu -> Export as Power BI Template.

Exporting Measure and Column formulas from Power BI

3. Exported PowerBI template will have the extension .pbit. Open the PowerBI template file as RAR file.

Exporting Measure and Column formulas from Power BI

4. List of files in PowerBI template.

Exporting Measure and Column formulas from Power BI

5. Click and Open DataModelSchema in any JSON editor.There are plenty of JSON editor available  online.  You can access the below link to use the same JSONeditor used here in this blog.
https://jsoneditoronline.org/

6. Generally, JSON  is represented as a Key Value Pair. You can Navigate to the Key Value Pair of tables which will list all the  tables used in the PowerBI report.
E.g.: In the below highlighted section we use the Key as tables and Value within the set bracket[]

Exporting Measure and Column formulas from Power BI

7. For each key value pairs inside tables key have following structure. Columns and Measures created in PowerBI will have separate key value pair. Here we have just highlighted the Measure Key Value Pair.

Exporting Measure and Column formulas from Power BI

8. After expanding the Measure key, we can get the value of each Measures. Here the value as DAX formula.

Exporting Measure and Column formulas from Power BI

9. Copy the value of the Key Measure.

Exporting Measure and Column formulas from Power BI

10.  Paste the copied Value of the Key Measure in any of the JSON to CSV editor. You can refer this website to learn more. https://json-csv.com/

11. CSV File will have the following structure. This is the based Value of the Key MeasureIt may differ for the Key Value Pair of Column.

Exporting Measure and Column formulas from Power BI

By this we have achieved exporting Measure and Column formulas from Power BI to a CSV File.

Know more about Microsoft Power BI services offerings from Visual BI solutions here.


Corporate HQ:
5920 Windhaven Pkwy, Plano, TX 75093

+1 888-227-2794

+1 972-232-2233

+1 888-227-7192

solutions@visualbi.com


Copyright © Visual BI Solutions Inc.

Subscribe To Our Newsletter

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!

Share This!

Share this with your friends and colleagues!