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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

How to get SQL query for report

I want to see the Oracle SQL query generated by the PBI report (PBI service), I am using the Oracle database as my source and connecting using Live connection, please let me know how and where we can see the SQL Query.

 

2 ACCEPTED SOLUTIONS
v-frfei-msft
Community Support
Community Support

Hi @Anonymous,

 

Here I made a test to connect to Oracle database using Direct Query in Power BI desktop. To see the query for Power BI desktop report, we can find the file named FlightRecorderCurrent.trc in the file path as below. And then use SQL server Profiler to open the file to get SQL query .

 

C:\Users\Username\Microsoft\Power BI Desktop Store App\AnalysisServicesWorkspaces\AnalysisServicesWorkspacexxxx\Data
 
As in the picture, we can find the SQL query easily.
 
pastedImage.png
 
 
For the report in power Service, aiming to see the SQL query, we can change the setting of Microsoft.PowerBI.DataMovement.Pipeline.GatewayCore.dll.config file, Just change the EmitQueryTraces value from False to True. Please refer to the online document.Through this way we can get the SQL query like this:
 
pastedImage (1).png
 
 
Regards,
Frank
 
Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

v-frfei-msft
Community Support
Community Support

Hi @Anonymous,

 

Does this make sense? If yes, kindly mark the answer as solution please. Thanks!

 

Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

6 REPLIES 6
v-frfei-msft
Community Support
Community Support

Hi @Anonymous,

 

Does this make sense? If yes, kindly mark the answer as solution please. Thanks!

 

Regards,
Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Yes that helped

Thanks

Anonymous
Not applicable

@v-frfei-msft: i am nt able to find the folder path given in the solution. can you help? struggling with the same problem.

 

Priya

Did you got the file path that was mentioned in the solution

Anonymous
Not applicable

No i did not get that

v-frfei-msft
Community Support
Community Support

Hi @Anonymous,

 

Here I made a test to connect to Oracle database using Direct Query in Power BI desktop. To see the query for Power BI desktop report, we can find the file named FlightRecorderCurrent.trc in the file path as below. And then use SQL server Profiler to open the file to get SQL query .

 

C:\Users\Username\Microsoft\Power BI Desktop Store App\AnalysisServicesWorkspaces\AnalysisServicesWorkspacexxxx\Data
 
As in the picture, we can find the SQL query easily.
 
pastedImage.png
 
 
For the report in power Service, aiming to see the SQL query, we can change the setting of Microsoft.PowerBI.DataMovement.Pipeline.GatewayCore.dll.config file, Just change the EmitQueryTraces value from False to True. Please refer to the online document.Through this way we can get the SQL query like this:
 
pastedImage (1).png
 
 
Regards,
Frank
 
Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.