Power Query is where a report is won or lost. Six actions — remove, filter, retype, unpivot, merge, group — turn a spreadsheet held together by merged cells into a table a model can use. Every step is recorded, so next month's file cleans itself.
| 1 · Remove columns | narrow |
| 2 · Filter rows | smaller |
| 3 · Change types | correct |
| 4 · Unpivot | tall |
| 5 · Merge / append | joined |
| 6 · Group by | summarised |
Select the columns you need, then Home → Remove Columns (or right-click → Remove Other Columns). Do this first: every later step runs on fewer columns and the file loads faster. A 40-column export usually needs six.
Wrong when: you remove a column a later step needs as a join key. Keep keys until the merge is done.
Use the column header dropdown to exclude test orders, closed regions or total rows. If the file has a summary row at the bottom, filter it out here or every SUM later will be double.
Wrong when: the business may later ask about the rows you filtered. If so, keep them and filter in DAX instead — a filter in Power Query is irreversible for everyone downstream.
Right-click the column header → Change Type. Dates as dates, amounts as decimal numbers, IDs as text (leading zeros matter). The ABC/123 indicator in the header tells you what Power Query currently thinks a column is.
Why not first: changing a date column to Date before filtering can turn "N/A" and "总计" rows into errors, which then spread through the query as Error values.
Exports love one column per month. Select the columns that identify a row (product, region), then Transform → Unpivot Other Columns. You get Date, Attribute, Value — a tall table that a date table can filter.
Before: Product | Jan | Feb | Mar
After: Product | Month | Sales
A | Jan | 120
A | Feb | 98
Pivot is the reverse and rarely what you want: it hard-codes columns, so next January's data has nowhere to go.
Merge adds columns from another table on a matching key (like VLOOKUP, but for whole tables). Append stacks tables with the same columns (like copy-paste from several monthly files).
Prefer loading a folder over appending by hand: Get Data → Folder reads every file in a directory and appends them with the same steps. Next month's file just needs to be dropped in.
Transform → Group By produces a summary table in the query. Usually you do not need this: DAX measures aggregate far more flexibly. Group by only when you are building a small dimension table (distinct products, distinct regions) or an aggregate table for performance.
Wrong when: you group the fact table and lose the row-level detail a slicer would need.
| Order | Reason |
|---|---|
| Remove → filter → retype | Fewer columns and rows means less work for type conversion, and no junk rows turning into errors. |
| Unpivot before merging | Unpivot changes the shape; merging into a shape you are about to change means doing the merge twice. |
| Merge last for lookups | A merge expands a lot of columns; removing them afterwards is easy, doing it before is not. |
| Group by only at the end | It discards detail. Anything that needs row-level detail must happen before it. |
C:UsersyouDesktopsales.xlsx breaks the moment the report is refreshed on another machine. Use a parameter, or load the folder instead of the file.
Manual cleanup is not recorded. If a colleague re-exports the file, the work is gone. Do it in Power Query so it repeats on refresh.
Each step is a safety net: click one to see the data at that moment. Deleting steps to "clean up" removes that debugging path.
Unused columns cost memory and refresh time, and they clutter the field list so the model is harder to navigate.
Use Close & Apply only after reviewing the last step's output. Loading a broken query writes a broken table.
Rename columns to what the report says — Amount, OrderDate — before loading. Renaming later means fixing every measure that referenced the old name.
No for these six actions — the interface records them. M matters when you need a custom column with logic the UI cannot express, or when you want to parameterise a path.
No. It runs on refresh and stores the result in the model (Import mode). Query performance affects refresh time, not click response.
Shape and type fixes belong in Power Query. Calculations that must respond to filters belong in DAX. Cleaning in DAX means repeating the logic in every measure.
Select columns by name rather than by position, and use "Unpivot Other Columns" instead of listing columns. If headers change names, load the folder and promote headers per file.
Usually a type conversion on text that is not a date (totals rows, "N/A", locale formats like 01/02/2026 meaning different days). Filter those rows out before changing the type, and set the locale explicitly in Change Type → Using Locale.
Split the cleaned table into fact and dimensions, and add the date table that time intelligence needs.
Once the model is clean, these are the measures most reports actually need.