Power QueryExercises

Table.SelectColumns

Table function · By Tahir Nas · Examples run in our simulator · Published · Updated

Keeps the listed columns, in the listed order.

When to use it

Use it when a report needs a fixed set of columns in a fixed order. Columns the source adds later are left out, which keeps downstream tables stable. If you'd rather keep everything except a few columns, use Table.RemoveColumns instead.

Syntax

Table.SelectColumns(table as table, columns as any, optional missingField as nullable number) as table

Parameters

columns
A column name or list of names to keep.
missingField
MissingField.Error (default), MissingField.Ignore or MissingField.UseNull.

Returns

A table with only the chosen columns.

Example

Table.SelectColumns(#table({"Region", "Product", "Qty"}, {{"North", "Kite", 2}, {"South", "Reel", 5}, {"North", "Reel", 1}, {"West", "Kite", 4}}), {"Product", "Qty"})

Result

ProductQty
Kite2
Reel5
Reel1
Kite4

Example: tolerate a column the source may not send

MissingField.UseNull keeps the query running and fills the missing column with null instead of failing.

Table.SelectColumns(#table({"Region", "Amount"}, {{"North", 120}}), {"Region", "Amount", "Rep"}, MissingField.UseNull)

Result

RegionAmountRep
North120null

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

Common mistakes

The matching command in Excel

Excel for Windows
Home > Choose Columns
What you see
A checklist of every column opens; the ticked columns are kept.

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.SelectColumns

Learn more

Related functions

Official documentation: Table.SelectColumns on Microsoft Learn.