Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello there!
So, a bit of a specific thing. As im dealing with huge data bases. As many might know, when you use an SQL input, all the first appliable steps in PowerQuery will be "folded" into a SQL call so to optimize the query. Otherwise, you can create a manual SQL call, which has the benefit of having all SQL functionalities (such as SELECT DISTINCT, which wont work as query folding for Remove duplicates).
But, my question is, for the same process, lets say, just filtering by several conditions. Is there any benefit in doing a personal SQL call? Or is it better to just make normal steps and let it create its own native query call?
Im talking either about efficiency or good/standard use.
Im making my own tests, not sure yet, the native query created by PQuery is very ugly, but seems to work the same.
Solved! Go to Solution.
The goal of query folding is to try and push as much of the query to the data source, so it can be calculated in the original datasource. Typically this engine knows best how to handle the request in most performant way. Only the steps that can't be folded are then executed in Powr Query, which is usually less optimal.
Writing a your own query is typically a good practice if you are proficient and knowledgeable about the source system and know the data model, which functions there are available, etc... in addition, a query optimizer from e.g. a relational database engine is extremely good in knowing how to best handle the query you ask it, bars on the statistics, indexes, and many other metadata available. So chances are that if you can write it in a single query for the data source, that gets processed the most efficient. some operations you'll need to do in power query (e.g. detecting patterns, and other advanced services that are maybe not available in the source).
https://learn.microsoft.com/en-us/power-query/query-folding-basics
The goal of query folding is to try and push as much of the query to the data source, so it can be calculated in the original datasource. Typically this engine knows best how to handle the request in most performant way. Only the steps that can't be folded are then executed in Powr Query, which is usually less optimal.
Writing a your own query is typically a good practice if you are proficient and knowledgeable about the source system and know the data model, which functions there are available, etc... in addition, a query optimizer from e.g. a relational database engine is extremely good in knowing how to best handle the query you ask it, bars on the statistics, indexes, and many other metadata available. So chances are that if you can write it in a single query for the data source, that gets processed the most efficient. some operations you'll need to do in power query (e.g. detecting patterns, and other advanced services that are maybe not available in the source).
https://learn.microsoft.com/en-us/power-query/query-folding-basics
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
86 | |
81 | |
53 | |
37 | |
37 |