Power QueryExercises

Table.ExpandTableColumn

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

Expands a nested table column into columns (and rows).

When to use it

Use it after a merge or an All Rows group to turn the nested tables back into columns. Pick only the columns you need and give them clear names. If you only need a total, aggregate instead of expanding.

Syntax

Table.ExpandTableColumn(table as table, column as text, columnNames as list, optional newColumnNames as nullable list) as table

Parameters

columnNames
Columns to take from the nested tables.
newColumnNames
Optional output names.

Returns

The table with nested columns expanded.

Example

Table.ExpandTableColumn(#table({"K", "T"}, {{"a", #table({"x"}, {{1}, {2}})}}), "T", {"x"})

Result

Kx
a1
a2

Example: expand with new names

The fourth argument renames the expanded columns, avoiding clashes with existing ones.

Table.ExpandTableColumn(#table({"Order", "C"}, {{1, #table({"Name"}, {{"Ana"}})}}), "C", {"Name"}, {"Customer"})

Result

OrderCustomer
1Ana

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
The expand icon on a table column's header
What you see
You tick the fields of the nested table that should become columns.

Paths are for the Power Query editor in Excel for Microsoft 365, checked against Microsoft's documentation on 8 November 2026: Merge queries overview (Microsoft Learn).

Exercises that use Table.ExpandTableColumn

Learn more

Related functions

Official documentation: Table.ExpandTableColumn on Microsoft Learn.