Back to Resources
Technical

Query Folding in Power BI: The Secret to Faster Data Refresh Performance

Push transformations to the source for faster refreshes and lower load.

When you apply filters, merges, or column changes in Power Query, the engine can push those steps back to the data source so the database does the work and returns only the final result. That process is called query folding. Instead of loading an entire table into Power BI and then filtering it locally, a single optimized query (e.g. SQL) is sent to the source—reducing data transfer, memory use, and refresh time.

What is query folding?

Query folding is the process where Power Query takes the steps you apply—filtering rows, removing columns, merging queries, sorting—and translates them into the source system's native language (such as SQL). The source executes the logic and returns only the result set.

Power Query Editor showing Applied Steps pane
Applied Steps in Power Query—each step may or may not fold depending on the operation.

How folding works: full, partial, and none

If a step cannot be translated to the source, folding breaks from that point on—all later steps run locally.

  • Full folding: every step is pushed to the source; Power BI receives only the final result.
  • Partial folding: some steps run at the source, others run locally in Power Query.
  • No folding: all steps run in Power Query; more data is loaded and processed locally.

Initiating your query and the EnableFolding flag

Using Get Data and choosing a relational source (e.g. SQL Server, Snowflake) enables folding by default for subsequent supported steps. If you write a native query in the Advanced Editor with Value.NativeQuery, you must add the EnableFolding option or folding will not occur.

// In Advanced Editor, enable folding when using Value.NativeQuery:
Value.NativeQuery(Source, "SELECT * FROM Sales", null, [EnableFolding = true])

Verifying folding

Right-click a step in the Applied Steps pane and choose View Native Query. If it's available, folding is still active. If it's greyed out, the last step broke folding.

Right-click step and View Native Query
Use View Native Query to confirm folding is still active after each step.

Why query folding matters

  • Faster refresh and lower load: the source does filters and joins; less data is transferred.
  • Critical for DirectQuery: every visual triggers a query; folding keeps those queries optimized.
  • Required for incremental refresh: RangeStart and RangeEnd filters must fold to the source.

When does folding occur?

Folding works with SQL Server, Snowflake, PostgreSQL, Redshift, BigQuery, SAP HANA. Flat files (Excel, CSV, Web) do not support folding. Common foldable steps: filter rows, remove columns, merge (join), group by, append. Operations that break folding: combining different sources, custom columns with non-foldable M (e.g. Text.Middle), pivoting, index columns, Table.Buffer().

Incremental refresh and debugging

Incremental refresh relies on RangeStart and RangeEnd being pushed to the source; verify with View Native Query. If you use a native query, always confirm [EnableFolding = true] is set in the Advanced Editor.

Need help with your migration?

Our team can help you design, build, and optimize your Power BI and Fabric solutions.

Get a free assessment

Ready to modernize your BI stack?

Stop maintaining legacy workbooks. Start leveraging the full power of the Microsoft Data Platform today.