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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
TungNguyen_19
Helper III
Helper III

Filter by SQL statement or Add filter step in Power Query

Hi everyone,

Today I found this question: "If I have a large Microsoft SQL Server table (more than 100 million records). During the development process, I need to import a sample of the data from the table. From Power Query Editor, you import the table and then add a filter step to the query. Does this meet the goal?"

The thing I confuse does the data will fully loaded when I click on Transform data windows which mean the solution above is wrong?

Anyone can help me? I need some article or explains. Many thanks to you

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

The question topic is query folding - the substitution of Power Query transforms with custom queries in the native language of the data source.  Most often that is SQL  (and its variations like SOQL).  

 

So when you add a filter step to the Power Query actions that filter is then translated into SQL code, and the custom code is run at the data source instead of in Power Query.  You can (mostly) observe that ths is happening by checking the "View Native Query" context menu for each Power Query step.

 

If you observe that the data is fully loaded then Query folding is not happening because either your source doesn't support it, or you added a transform that could not be translated. 

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

The question topic is query folding - the substitution of Power Query transforms with custom queries in the native language of the data source.  Most often that is SQL  (and its variations like SOQL).  

 

So when you add a filter step to the Power Query actions that filter is then translated into SQL code, and the custom code is run at the data source instead of in Power Query.  You can (mostly) observe that ths is happening by checking the "View Native Query" context menu for each Power Query step.

 

If you observe that the data is fully loaded then Query folding is not happening because either your source doesn't support it, or you added a transform that could not be translated. 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.