Table.RemoveColumns
TableRemoves the specified columns from a table.
Syntax
Table.RemoveColumns(table as table, columns as any, optional missingField as nullable number) as tableParameters
| Name | Type | Required | Description |
|---|---|---|---|
table | table | Yes | The input table to remove columns from. |
columns | any | Yes | A column name or list of column names to remove. |
missingField | number | No | Controls behavior when a specified column does not exist. Use MissingField.Error (default), MissingField.Ignore, or MissingField.UseNull. |
Return Value
table — A table without the specified columns.
Remarks
Table.RemoveColumns returns a new table with the specified columns removed. Pass a single column name as text, or multiple column names as a list.
If a specified column does not exist in the table, an error is raised by default. As a best practice, always provide the third argument MissingField.Ignore to silently skip missing columns. This prevents broken refreshes if an upstream column is renamed or removed from the data source.
Examples
Example 1: Remove a single column
Table.RemoveColumns(Sales, "Region")Result
OrderID | CustomerName | Product | Category | UnitPrice | Quantity | OrderDate | |
|---|---|---|---|---|---|---|---|
| 1 | 1 | Alice | Widget A | Widgets | 25 | 4 | 1/15/2024 |
| 2 | 2 | Bob | Gadget B | Gadgets | 50 | 2 | 1/18/2024 |
| 3 | 3 | Charlie | Widget C | Widgets | 15 | 10 | 2/1/2024 |
| 4 | 4 | Alice | Gadget D | Gadgets | 75 | 1 | 2/10/2024 |
| 5 | 5 | Diana | Widget A | Widgets | 25 | 6 | 3/5/2024 |
| 6 | 6 | Bob | Thingamajig E | Misc | 120 | 1 | 3/12/2024 |
| 7 | 7 | Charlie | Gadget B | Gadgets | 50 | 3 | 4/1/2024 |
| 8 | 8 | Diana | Widget C | Widgets | 15 | 8 | 4/15/2024 |
Example 2: Remove multiple columns
Table.RemoveColumns(Sales, {"Category", "Region"})Result
OrderID | CustomerName | Product | UnitPrice | Quantity | OrderDate | |
|---|---|---|---|---|---|---|
| 1 | 1 | Alice | Widget A | 25 | 4 | 1/15/2024 |
| 2 | 2 | Bob | Gadget B | 50 | 2 | 1/18/2024 |
| 3 | 3 | Charlie | Widget C | 15 | 10 | 2/1/2024 |
| 4 | 4 | Alice | Gadget D | 75 | 1 | 2/10/2024 |
| 5 | 5 | Diana | Widget A | 25 | 6 | 3/5/2024 |
| 6 | 6 | Bob | Thingamajig E | 120 | 1 | 3/12/2024 |
| 7 | 7 | Charlie | Gadget B | 50 | 3 | 4/1/2024 |
| 8 | 8 | Diana | Widget C | 15 | 8 | 4/15/2024 |
Compatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks