Query folding: the silent performance killer

Query folding is what makes Power Query fast: instead of pulling every row into memory and transforming it locally, the Power Query engine translates your steps into a single query that runs at the source — in SQL, against a warehouse, wherever the data lives. The moment folding breaks, every step after that point runs locally, row by row, in the Power Query engine. Refreshes that took thirty seconds start taking thirty minutes, and nothing in the UI clearly tells you why.

How to check

Right-click any step in the Applied Steps pane. If "View Native Query" is available, that step still folds. The first step where that option disappears is where folding broke — everything from there onward runs locally.

Common folding breakers

Three habits

Do your filters and column removals early, before any custom logic — fewer rows and columns folded early means less work either way. Push transformations that have a native SQL or source equivalent (renames, simple calculations, type changes) ahead of anything bespoke. And when you do need a folding-breaking step, put it as late as possible in the query, so as little work as possible happens after the break.

Power Query M Performance

Get new articles by email

One email when something's worth reading. No spam, unsubscribe anytime.