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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
TeeGee
Helper II
Helper II

DirectQuery: How to view generated SQL per visual, with row count and execution time?

I am working with a fairly complex (5 slicers, 13 visuals) Power BI report that is attached to an Azure SQL database via DirectQuery.

 

Currently, I am examining the generated SQL via the SQL Server Query Store, which works "ok", but one downside is, there's no way of knowing which visual corresponds to each SQL statement.

 

Is there an alternative approach to debugging SQL where I would be able to see this association, and hopefully still see row count and execution time per statement?

4 REPLIES 4
v-chuncz-msft
Community Support
Community Support

@TeeGee,

 

DAX Studio can be used to capture queries, you may have a look.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

DAX Studio doesn't show which query belongs to which Visual though does it?

srinivt
Microsoft Employee
Microsoft Employee

The only thing you could do is move each of your visuals to a page of their own. Now when you reopen your pbix file, the queries will be sent only for your active page, which could help you to debug and relate it to the corresponding SQL query/queries. 

Well sure, you can do that, but if you have a poorly performing piece of SQL that you notice executing on the backend, having to go through a trial and error process to find out which visual it belongs to is not a great use of a person's time.  Yes, I realize that based on the contents of the query you can very often (but not always!) narrow it down to a smaller subset of visuals to consider, but the point is, you shouldn't have to do this.  Microsoft devs control this entire stack, outputting the underlying visual with the SQL shouldn't be terribly technically difficult I wouldn't think.

 

Rumor has it this change is in the queue somewhere, so hopefully it isn't too far down the list.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.