Table.RemoveColumns
Table function · By Tahir Nas · Examples run in our simulator · Published · Updated
Removes the listed columns and keeps everything else.
When to use it
Use it to drop known columns, such as personal data or helper columns, while letting every other column through. It suits feeds where new columns should appear automatically. For a fixed output schema, Table.SelectColumns is safer.
Syntax
Table.RemoveColumns(table as table, columns as any, optional missingField as nullable number) as tableParameters
- columns
- Column name or list of names to remove.
- missingField
- What to do if a listed column doesn't exist.
Returns
The table without those columns.
Example
Table.RemoveColumns(#table({"Region", "Product", "Qty"}, {{"North", "Kite", 2}, {"South", "Reel", 5}, {"North", "Reel", 1}, {"West", "Kite", 4}}), {"Region"})Result
| Product | Qty |
|---|---|
| Kite | 2 |
| Reel | 5 |
| Reel | 1 |
| Kite | 4 |
Example: remove columns that may already be gone
MissingField.Ignore lets the step succeed whether or not the column is still in the source.
Table.RemoveColumns(#table({"Name", "Email", "Score"}, {{"Ana", "a@x.example", 7}}), {"Email", "Phone"}, MissingField.Ignore)Result
| Name | Score |
|---|---|
| Ana | 7 |
Both results are produced by the Power Query Exercises simulator, an independent implementation of a documented subset of M, and checked on every build.
Good to know
- New source columns pass through, which suits 'everything except' feeds.
Common mistakes
- Removing columns by position with generated code, which breaks when the source order changes.
- Removing a column that a later step still refers to.
The matching command in Excel
- Excel for Windows
- Home > Remove Columns, or right-click a column header > Remove Columns
- What you see
- The selected columns are removed and every other column passes through.
Paths are for the Power Query editor in Excel for Microsoft 365, checked against Microsoft's documentation on 8 November 2026: Choose or remove columns (Microsoft Learn).
Exercises that use Table.RemoveColumns
- beginner~5 minFree
Remove salary and email before sharing a roster (logistics)
Share a staff list with managers without salary or email columns.
- beginner~7 minFree
Convert Yes/No answers to true, false or null (charity)
The marketing opt-in column mixes Yes, Y, no, N, blanks and nulls. Turn it into a proper true/false column.
- intermediate~7 minFree
Split a timestamp into its date and hour (door access)
Each event has a text timestamp like 2026-03-04T14:30:00. Add a real Date and the Hour of day.
- intermediate~8 minFree
Remove every helper column whose name starts with tmp_ (survey)
The export tool adds working columns named tmp_…, and their number changes. Remove all of them by rule.
- intermediate~8 minFree
Sort tickets by business priority, not alphabetically (telecom)
Sort Urgent, High, Medium, Low (in that order), then oldest first within each priority.
- intermediate~8 minPro
Find orders from unknown customers (kite shop)
Use a left anti join to list orders whose customer isn't in the customer master.
Learn more
Related functions
Official documentation: Table.RemoveColumns on Microsoft Learn.