Forum Discussion

shashi432's avatar
shashi432
New Member
6 years ago
Solved

How to gete power bi report sql (oracle database) query.

Can anyone please let me know, how to get the power bi report query.

for e.g  I have created one report on power bi desktop  I wanted to see the corresponding sql  generated by this report.

 

already tried this link:

https://community.powerbi.com/t5/Desktop/How-to-get-SQL-query-for-report/m-p/459830#M213273

but above link for sql server I'm using oracle database in backend and connected it with odbc driver.

FlightRecorderCurrent.trc is not working in above case. so can anyone tell any simple way to get the sql query after creat

 

  • shashi432's avatar
    shashi432
    6 years ago

    Thanks Martyn,

     

     I am not using direct query mode, I'm using import query mode.

    Thanks for the link , yes I wanted to check my pbi report query performance; so as you have given me some guide link.

     

     I'll go through and let you know for any other issue. 🙂

     

     

4 Replies

  • Hi shashi432 

     

    Open the Power Query Editor then for each query, right click on the last applied step in the list:

     

    If the 'View Native Query' option is greyed out, right click on the steps above until it's visible.

    This will show you the SQL sent to the underlying data source.

     

    Best regards,
    Martyn


    If I answered your question, please help others by accepting it as a solution.

    • shashi432's avatar
      shashi432
      New Member

       

      Hi Martyn,

      Thanks for your response, but this is the not giving the correct output. for e.g

      i have created following report on report section

      and when you go to the query editor and will try to see the native query that will show you the table you imported from database.

       

      But my requirement is ; I would like to see the report/dashboard which I have created, query of that report/dashboard.

       

      native query is giving  the query which you have imported or modified on query editor.

       

       

       
       
      • MartynRamsden's avatar
        MartynRamsden
        Solution Sage

        Hi shashi432 

         

        If you're using Direct Query mode, you could capture the SQL queries being passed from Power BI to your Oracle database using your DBMS (e.g. Toad for Oracle).

         

        However, if you're using import mode, there are no SQL queries generated once your data has been loaded; all queries passed to the Vertipaq engine are DAX.

        If you want to capture the DAX queries generated as you interact with your report, you can use the 'Performance analyzer' within Power BI. This is a good guide: www.sqlbi.com/articles/introducing-the-power-bi-performance-analyzer/ 

         

        Best regards,
        Martyn


        If I answered your question, please help others by accepting it as a solution.