Forum Discussion

PrachiJain_2025's avatar
PrachiJain_2025
Kudo Collector
1 year ago
Solved

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

  • 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 | Microsoft Learn

    FYI:

     

    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.

     

     

  • V-yubandi-msft's avatar
    V-yubandi-msft
    1 year ago

    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..

7 Replies

  • V-yubandi-msft's avatar
    V-yubandi-msft
    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 | Microsoft Learn

    FYI:

     

    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.

     

     

  • V-yubandi-msft's avatar
    V-yubandi-msft
    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's avatar
    V-yubandi-msft
    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's avatar
      V-yubandi-msft
      Community Support

      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's avatar
    V-yubandi-msft
    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.