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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cuongle
Advocate II
Advocate II

How Power BI direct query optimise SQL

I am not sure that I understand how Power BI direct query works under the hood and whether Power BI optimise the query or not. Assume I have a filter (slicer with single selection) binding on column ColumnX in order to filter data on table: TableY

 

When user select value on slicer, does Power BI optimise query like:

 

SELECT * FROM TABLE tableY

WHERE ColumnX = 'Value'

 

Or, Power BI get all data from TableY and then filter happens in memory

 

 

1 ACCEPTED SOLUTION
Eric_Zhang
Employee
Employee

@cuongle

For SQL Server, I've captured what Power BI does in direct query when selecting the slicer, with the help of SQL Server profiler. Power BI actually sends a query with where filter as you mentioned, instead of get all data and filter in memory, though the query is usually not efficient.  So I think the similar behavior is applied when connecting to other databases and it can be easily proved with individual profiler tools.

 

 

View solution in original post

1 REPLY 1
Eric_Zhang
Employee
Employee

@cuongle

For SQL Server, I've captured what Power BI does in direct query when selecting the slicer, with the help of SQL Server profiler. Power BI actually sends a query with where filter as you mentioned, instead of get all data and filter in memory, though the query is usually not efficient.  So I think the similar behavior is applied when connecting to other databases and it can be easily proved with individual profiler tools.

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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