Query folding
Understand where transformation work runs
Query folding is Power Query translating eligible transformations into operations executed by a source system. With full folding, the source handles the transformations in the query; with partial folding, some work remains in Power Query; with no folding, transformations are performed by Power Query after retrieval. Source selection and retrieval still occur. The engine can optimize and reorder operations while preserving semantics, so the visual order of Applied Steps is not a guaranteed execution plan. Folding and source efficiency are different: an expensive folded query may still scan many rows.
Example 1: compare equivalent execution boundaries
Use the existing five-line sales fixture. Filter Region to North and retain LineID and Quantity. In a fictional plan A, SQL returns only those two fields for matching records; in plan B, Power Query retrieves all five rows and filters/projects locally. Both plans should return L01/2, L02/1, L04/1 (4 units). Plan A has a smaller result payload in this simplified single-retrieval model. Actual network bytes also include protocol, metadata, compression and additional requests. The following SQL is illustrative SQL Server syntax, not a captured folded query.
SELECT LineID, QuantityFROM dbo.SalesWHERE Region = N'North';The SQLite lab uses an equivalent query against a local synthetic table. It establishes values, not connector translation, network savings or actual server performance.
Example 2: distinguish partial folding from no folding
Suppose a mock plan shows SQL source filtering to North, then a local custom formatting function generates a label from LineID. A second mock plan shows all rows retrieved and the entire filter and label calculation performed locally. The first plan is partial and the second has no folding for the transformations. A local fixture demonstrates the expected semantics independently.
let T = #table(type table [LineID=text, Region=text, Quantity=number], {{"L01","North",2},{"L02","North",1},{"L03","South",3}, {"L04","North",1},{"L05","South",2}}), North = Table.SelectRows(T, each [Region] = "North"), Label = Table.AddColumn(North,"Label",each "Line " & [LineID],type text)in Table.SelectColumns(Label,{"LineID","Quantity","Label"})Expected three rows, with labels Line L01, Line L02, Line L04. This inline table has no external source to fold into; it is not a folding experiment. Do not infer that text concatenation always prevents folding on a real connector.
Collect evidence instead of guessing
Where supported, Desktop View Native Query can show a translated query for a step. A disabled option alone is not conclusive evidence of no folding. Power Query Online folding indicators describe the query up to a step; its query plan distinguishes source work and engine work where available. Desktop Query Diagnostics and authorized source-side query evidence can supplement these tools. Distinguish preview, schema discovery, and refresh queries; record exact host/build/connector and which action triggered evidence. Do not interpret a query plan as a runtime benchmark. Compare row counts, totals, actual data transferred, elapsed time and source load under equivalent conditions, with privacy checks enabled. Prefer filters and projections early when semantically correct, but verify actual behavior.
Practice: classify three mock plans
A: source returns matching North lines and requested columns; B: source returns North lines, local engine creates labels; C: source returns every line and the local engine filters and creates labels. Classify the plans for their specified transformations. Explain why neither a fast preview nor a disabled native-query menu proves folding status.
Official reading
folding · indicators · plan · examples · diagnostics · desktop