Table.StopFolding is a Power Query M function that prevents any downstream operations from being run against the original source of the data in the table.
Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365
Syntax
Table.StopFolding( table as table ) as table
Description
The Table.StopFolding function serves to stop query folding, preventing transformations from being pushed back to the data source. This is useful when you need to optimize performance in specific situations where query folding is not beneficial.
Unlike alternative methods, like buffering the entire table into memory or adding an index column, this function accomplishes the goal with no additional side effects.
Applying the function ensures that subsequent operations are computed in Power Query, not against the original data source.
Examples
Fetches data from a SQL table in a way that prevents any downstream operations from running as a query on the SQL server.
// Output: table
let
Source = Sql.Database( "SomeSQLServer", "MyDb" ),
MyTable = Source{[Item="MyTable"]}[Data],
MyLocalTable = Table.StopFolding( dbo_MyTable )
in
MyLocalTable
Related articles
Learn more about Table.StopFolding in the following articles:
- Stop query folding with Table.StopFolding
Improve performance by controlling query folding with Table.StopFolding. Learn how to stop transformations from pushing back to the data source without sacrificing efficiency. » Read more
