Forum Discussion
View SQL query in direct query mode
Is there anyway to view the SQL generated by Power BI desktop for direct SQL queries?
Thanks!
15 Replies
- ricardocamargosContinued Contributor
Hi OneWithQuestion,
Power BI Desktop creates a file "FlightRecorderCurrent.trc." on:
"\<User>\AppData\Local\Microsoft\Power BI Desktop\AnalysisServicesWorkspaces"
Or you can also enable it on the file -> options -> diagnostics
References: https://docs.microsoft.com/en-us/power-bi/desktop-directquery-about
Thanks,
Ricardo
- OneWithQuestionPost Prodigy
So it appears that the trace files generated cannot be opened which is really odd.
When I go to open it with Profiler I get this error: Can't open PowerBI trace file: Needs TraceDefinition 15.0.0.xml
- ricardocamargosContinued Contributor
- OneWithQuestionPost Prodigy
I am trying to read the trace file for PowerBI Desktop, but it says I cannot open the file:
----
Unable to locate trace definition file Microsoft Analysis Services TraceDefinition 15.0.0.xml for open trace file FlighRecorderBack.trc.....
----
How are we supposed to obtain this file?
I have SQL 2017 installed on my local and SSMS 17.4 but don't see where we are supposed to get the TraceDefinition 15.0.0.xml file?
- dexterzHelper II
- RobertSlatteryResponsive Resident
After opening SQL Profiler from SSMS Tools, have PBI Desktop open and connect to the localhost:XXXXX server that you can see in Dax Studio. Then, open the trace file and it will work.
- nedpbiHelper I
Just to add in case anyone else is facing the "Unable to open trace definition file" error, I was able to resolve this by doing the following in the SQL profiler:
File ->Templates -> New Template -> Select the correct server type from the drop down -> Template name -> Select events -> Save
Once I did the above I was able to set the trace on a database in power bi service.