Downloads
Power Query MTable: columnsBeginner

Table.ReorderColumns

Moves the named columns to the front, in the order you list them.

Syntax
Table.ReorderColumns(table as table, columnOrder as list, optional missingField as nullable number) as table

Returns: The table with its columns rearranged. Columns you do not name follow in their current order.

What it does

Table.ReorderColumns changes the left-to-right order of columns in the table. It does not remove any columns. Use it to put the key fields first, such as account and name, so the table reads well in the editor and in the report.

Syntax and arguments

Example

A trial balance export has its account number and account name in the middle of the sheet. They are moved to the front.

let
    Source = Excel.CurrentWorkbook(){[Name = "TrialBalance"]}[Content],
    KeyFirst = Table.ReorderColumns(Source, {"Account", "Account Name"})
in
    KeyFirst

Account and Account Name become the first two columns. All the other columns follow in their original order.

Example: a second, different use

After a budget grid is unpivoted, the columns come out in a different order. The reshaped table is arranged as account, month and amount for the budget model.

let
    Source = Excel.CurrentWorkbook(){[Name = "Budget2026"]}[Content],
    Long = Table.UnpivotOtherColumns(Source, {"Account"}, "Month", "Budget"),
    Arranged = Table.ReorderColumns(Long, {"Account", "Month", "Budget"})
in
    Arranged

Things to watch

In business terms

A consistent column order makes a schedule easier to check by eye and easier to hand to someone else. For a model that loads the table, the order of key fields is a readability choice rather than a calculation.

Related functions

All Power Query M functions · View as Markdown · M basics