Learn Power BI
40 lessons · Power Query · Modelling · Visuals · Advanced
0/40 completed
Lesson 1 of 10
Remove & Select Columns
Removing unwanted columns is the first step in any Power Query pipeline. Table.RemoveColumns drops named columns; Table.SelectColumns keeps only what you specify and discards the rest. Both return a new table — Power Query transforms are non-destructive. Dropping columns early reduces memory usage and improves refresh performance.
💡
Use Table.SelectColumns over Table.RemoveColumns when the output schema is fixed — it protects against new source columns silently appearing in your model.
Code ExamplePower Query M
let
Source = Excel.CurrentWorkbook(){[Name="Sales"]}[Content],
// Keep only the columns you need
Clean = Table.SelectColumns(Source, {
"Date", "Region", "Product", "Revenue"
}),
// Or remove specific unwanted columns
// Clean = Table.RemoveColumns(Source, {"Notes","InternalID","Legacy"})
in
CleanSimulator
Before
| Date | Region | Product | Revenue | Notes | InternalID | Legacy |
|---|---|---|---|---|---|---|
| 2024-01-15 | UK | Widget A | 4500 | n/a | XZ001 | Y |
| 2024-01-22 | US | Widget B | 7200 | XZ002 | N |
After
| Date | Region | Product | Revenue |
|---|---|---|---|
| 2024-01-15 | UK | Widget A | 4500 |
| 2024-01-22 | US | Widget B | 7200 |
Notes, InternalID and Legacy dropped — model is cleaner and faster.
Quick Check
Which function keeps ONLY the columns you list, discarding all others?