Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Does a resource exist listing which M fuctions can be code folded? I am assuming it depends on the SQL engine, but it would be very helpful to know which M functions can be run on the database.
Hi @dragsdale ,
Relational data source transformations that can be query folded are those that can be written as a single SELECT statement. A SELECT statement can be constructed with appropriate WHERE, GROUP BY, and JOIN clauses. It can also contain column expressions (calculations) that use common built-in functions supported by SQL databases.
Generally, the following list describes transformations that can be query folded.
Removing columns.
Renaming columns (SELECT column aliases).
Filtering rows, with static values or Power Query parameters (WHERE clause predicates).
Grouping and summarizing (GROUP BY clause).
Expanding record columns (source foreign key columns) to achieve a join of two source tables (JOIN clause).
Non-fuzzy merging of fold-able queries based on the same source (JOIN clause).
Appending fold-able queries based on the same source (UNION ALL operator).
Adding custom columns with simple logic (SELECT column expressions). Simple logic implies uncomplicated operations, possibly including the use of M functions that have equivalent functions in the SQL data source, like mathematic or text manipulation functions. For example, the following expressions returns the year component of the OrderDate column value (to return a numeric value).
Pivoting and unpivoting (PIVOT and UNPIVOT operators).
Please refer: Transformations that can achieve folding
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks.
This is the same resource I looked at. It sounds like no such rource exists to identify which M Fuctions (https://docs.microsoft.com/en-us/powerquery-m/power-query-m-function-reference) can become native. Overall I am very impressed with power bi's ability to convert to native sql. I will just keep checking.
@dragsdale
Is your question on forcing query folding, the function is Value.NativeQuery() and EnableFolding=true
Refer to this article:
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 19 | |
| 10 | |
| 9 | |
| 7 | |
| 6 |