Power Query steps
A query is a reusable transformation recipe
Power Query connects to data and produces a transformed table for analysis. In Power BI Desktop, open Transform data after connecting to a local file. The Queries pane lists queries, the central preview displays the selected result, and Query Settings contains the query name and Applied Steps. A source CSV remains unchanged when you transform its imported representation. The Source step connects to the file; a Navigation step, when generated by the connector, selects an object such as a workbook sheet. CSV queries need not have a Navigation step. Give queries names that describe their role, such as SalesRaw and NorthSales. A query name is not a file name.
Example 1: trace a small table through steps
Use a new blank query in the Desktop lab, with the Advanced Editor open. This complete M expression is illustrative and has not been executed in a native engine. #table constructs a small table, let names intermediate expressions, and in selects the returned result. each introduces a row predicate: keep the row when Region equals North. Table.SelectColumns returns only the named fields. A step with spaces in its name uses the quoted identifier syntax #"North Only".
let Source = #table({"LineID", "Region", "Quantity"}, {{"L01", "North", 2}, {"L02", "North", 1}, {"L03", "South", 3}}), #"North Only" = Table.SelectRows(Source, each [Region] = "North"), Selected = Table.SelectColumns(#"North Only", {"LineID", "Quantity"})in SelectedExpected table (offline prediction):
| LineID | Quantity |
|---|---|
| L01 | 2 |
| L02 | 1 |
Source contains three rows and three columns; North Only has two rows and three columns; Selected has two rows and two columns. This is an untyped teaching table: the later CSV lab explicitly specifies column types. Do not paste it over an existing query.
Example 2: inspect a dependency before editing
On the same example, click North Only in Applied Steps. The formula bar, if enabled, shows that expression rather than the entire query. Advanced Editor exposes the complete script. Rename the Selected identifier and its reference after in together if editing manually. If you change the filter to South, the final expected table is L03 with quantity 3; changing a step can change every result that depends on it. M describes dependencies, not a guarantee that the engine physically executes every named step once in the displayed order. The engine may optimize evaluation. The editor may regenerate step names; use the actual names in your query.
Common mistake: treating step removal as harmless
Suppose you move the selection before the Region filter while still selecting only LineID and Quantity. The filter would reference a field that is no longer present. Keep Region until after filtering, or revise the dependency. Inspect both earlier and later steps before deleting a step. Avoid editing the raw file to make the preview look correct. Column type icons describe the current assigned types, not proof that every source value converts successfully.
Practice: predict step results
Using the example, predict the final row count and quantity total if you filter South and retain LineID and Quantity. Then explain why selecting only LineID before filtering Region fails. Compare with the restricted practice key. Next, learn why inspecting a successful preview is not a full refresh test.
Official reading
Desktop query overview · Applied Steps · Query evaluation · Table.SelectRows · Table.SelectColumns. Source extracts checked 2026-11-29; exact build and native M execution NOT RUN.