Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! 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
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.