Forum Discussion

OneWithQuestion's avatar
OneWithQuestion
Post Prodigy
8 years ago

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

    • OneWithQuestion's avatar
      OneWithQuestion
      Post 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 

       

       

       

       

  • 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?

  • RobertSlattery's avatar
    RobertSlattery
    Responsive 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.

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