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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Difference between writing a native query and applying a filter in M

Hi everyone

I would like to understand if there is any difference, in terms of performance, between writing a native query to filter some rows and doing that same operation in power query steps 

Meaning: let's say I have a Sales Table that I import in my model

Option 1: I write in the native query panel "select * from sales where date > 01012020. Then I load to model

Option 2: I do not write a native query, I simply connect to the table, then apply a filter over the date column saying that the date must be great than 010102020. This creates a query step. Then I load to model 

Is there any difference between this two options in terms of performance? If the topic is more complex and I'm oversimplyfing please refer me to some documentation 

Thanks 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

AFAIK it's basically as @Greg_Deckler said.

 

If you're writing custom SQL, you have to be 100% sure of your SQL skills and perform all the transformations in the SQL script, because it will break query folding and you won't be able to fold any step done in the PQ interface.

 

If your data source supports query folding and you're performing very simple transformations such as filtering columns, these should be folded and you shouldn't notice any difference in performance.

 

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@Anonymous My understanding is that if the query can be folded then it should essentially result in being the same thing both ways. However, if it cannot be folded, then Power BI would need to load all of the data and then filter it down which could be a significant performance it. You should be able to test this quite easily as SQL connector allows you to put SQL code into the base query.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

AFAIK it's basically as @Greg_Deckler said.

 

If you're writing custom SQL, you have to be 100% sure of your SQL skills and perform all the transformations in the SQL script, because it will break query folding and you won't be able to fold any step done in the PQ interface.

 

If your data source supports query folding and you're performing very simple transformations such as filtering columns, these should be folded and you shouldn't notice any difference in performance.

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors