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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply

How can I export the DAX query generated by a specific visual using the Performance Analyzer in Powe

How can I export the DAX query generated by a specific visual using the Performance Analyzer in Power BI Desktop? dymamically uisng spark code

2 ACCEPTED SOLUTIONS
V-yubandi-msft
Community Support
Community Support

Hi @PrachiJain_2025 ,

Thank you for engaging with the Microsoft Fabric Communit. 

1. Open Power BI Desktop and go to the View tab, then select Performance Analyzer.

2. Start recording, refresh or interact with the visual, and once it loads, click Copy Query under the visual.

3. Paste the DAX query into a text editor for further analysis.
Use Performance Analyzer to examine report element performance in Power BI Desktop - Power BI | Micr...

FYI:

Vyubandimsft_0-1744364718189.png

 

2, Currently, Power BI Desktop does not support programmatic access to DAX queries from visuals using tools like Spark, Python, or any API.

Reasons:

  1. The Performance Analyzer is a manual feature in the Power BI Desktop UI.
  2. Microsoft has not provided a public API or SDK to dynamically extract these queries from visuals.
  3. Tools like Spark or other scripting environments cannot directly access visuals or the semantic model in Power BI Desktop.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

View solution in original post

Currently, Semantic Link  allows programmatic access to semantic model metadata and measure evaluation using Spark (Python), but it does not expose the actual DAX query generated by a specific visual in a Power BI report (like Performance Analyzer does).

Semantic link and Power BI connectivity - Microsoft Fabric | Microsoft Learn

 

If you're looking to analyse or automate DAX queries at the model level, consider these options:

  1. Connect to your Power BI or Fabric semantic model using the XMLA endpoint for programmatic access.
  2. Use tools like DAX Studio, Tabular Editor, or SQL Server Management Studio (SSMS) to explore, run, and monitor DAX queries directly against the dataset.

Thanks..

View solution in original post

7 REPLIES 7

Thank you, will wait for dynamic option using Semantic Link

V-yubandi-msft
Community Support
Community Support

Hi @PrachiJain_2025 ,

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

V-yubandi-msft
Community Support
Community Support

Hi @PrachiJain_2025 ,

Has your issue been resolved, or do you require any further information? Your feedback is valuable to us. If the solution was effective, please mark it as 'Accepted Solution' to assist other community members experiencing the same issue.

V-yubandi-msft
Community Support
Community Support

Hi @PrachiJain_2025 ,

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution we provided for your issue worked for you  or let us know if you need any further assistance?

Your feedback is important to us, Looking forward to your response. 

Does there any  feature available using semantic library?

Currently, Semantic Link  allows programmatic access to semantic model metadata and measure evaluation using Spark (Python), but it does not expose the actual DAX query generated by a specific visual in a Power BI report (like Performance Analyzer does).

Semantic link and Power BI connectivity - Microsoft Fabric | Microsoft Learn

 

If you're looking to analyse or automate DAX queries at the model level, consider these options:

  1. Connect to your Power BI or Fabric semantic model using the XMLA endpoint for programmatic access.
  2. Use tools like DAX Studio, Tabular Editor, or SQL Server Management Studio (SSMS) to explore, run, and monitor DAX queries directly against the dataset.

Thanks..

V-yubandi-msft
Community Support
Community Support

Hi @PrachiJain_2025 ,

Thank you for engaging with the Microsoft Fabric Communit. 

1. Open Power BI Desktop and go to the View tab, then select Performance Analyzer.

2. Start recording, refresh or interact with the visual, and once it loads, click Copy Query under the visual.

3. Paste the DAX query into a text editor for further analysis.
Use Performance Analyzer to examine report element performance in Power BI Desktop - Power BI | Micr...

FYI:

Vyubandimsft_0-1744364718189.png

 

2, Currently, Power BI Desktop does not support programmatic access to DAX queries from visuals using tools like Spark, Python, or any API.

Reasons:

  1. The Performance Analyzer is a manual feature in the Power BI Desktop UI.
  2. Microsoft has not provided a public API or SDK to dynamically extract these queries from visuals.
  3. Tools like Spark or other scripting environments cannot directly access visuals or the semantic model in Power BI Desktop.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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