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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Bokchoy
Helper II
Helper II

Query Folding compared to writing SQL statement

Hi all,

 

 

When importing data from SQL, i usually load in the data alongside a pre-written SQL statement with most transformation defined. From my understanding of QueryFolding, it does the exact same thing for you step by step with each transformation done on PowerQuery.


Is there any difference in performance given that transformation is identical between both methods? Wouldn’t having a pre-written SQL statement be more efficient on the SQL side and prevent potential table locking?
Also, can i enable Queryfolding after hand when I import the data with an SQL script?

 

 

 

 

1 ACCEPTED SOLUTION
SpartaBI
Community Champion
Community Champion

@Bokchoy 
Pre-written SQL statement with NO power query transformations is the most efficient.
If you use it then you can't add power query steps or you will lose folding.
If you use the GUI of Power Query then you can also achieve Query folding but that's depend on the transformations you do. 
You can check to see if the query is folded by right clicking the last step and view the native query if available. Best thing is to check with SQL profiler what is the queries being sent to the data source to verify if there was a query folding or not.



2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

View solution in original post

1 REPLY 1
SpartaBI
Community Champion
Community Champion

@Bokchoy 
Pre-written SQL statement with NO power query transformations is the most efficient.
If you use it then you can't add power query steps or you will lose folding.
If you use the GUI of Power Query then you can also achieve Query folding but that's depend on the transformations you do. 
You can check to see if the query is folded by right clicking the last step and view the native query if available. Best thing is to check with SQL profiler what is the queries being sent to the data source to verify if there was a query folding or not.



2022-05-19 17_30_22-Re_ Need help on DAX function with measure vs colu... - Microsoft Power BI Commu.png


Full-Logo11.png

SpartaBI_3-1652115470761.png   SpartaBI_1-1652115142093.png   SpartaBI_2-1652115154505.png

Showcase Report – Contoso By SpartaBI

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.