Table.RemoveColumns
The table without the columns you name.
Group: Table. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Table.RemoveColumns(table as table, columns as any, optional missingField as nullable number) as table
| Parameter | Type | Description |
|---|---|---|
table | table | The table to take columns out of. |
columns | any | A column name, or a list of names. |
missingField | nullable number optional | What to do when a named column isn't there: MissingField.Error (the default) or MissingField.Ignore. |
Returns
table. The other columns, in their order, with every row.
Remarks
- A name that isn't a column is an error, unless missingField is
MissingField.Ignore: useful when a source's columns come and go. Table.SelectColumnsnames the columns to keep instead: new columns in the source then stay out.
Examples
Without price and cost
Table.RemoveColumns(#table({"Product", "Price", "Cost"}, {{"Chair", 50, 30}}), {"Price", "Cost"})
| Product |
|---|
| Chair |
A column that may not be there
Table.RemoveColumns(#table({"Product", "Price"}, {{"Chair", 50}}), {"Price", "Discount"}, MissingField.Ignore)
| Product |
|---|
| Chair |
Related functions
Table.SelectColumns, Table.RenameColumns, Table.ColumnNames.