Power QueryExercises

Rename and reorder columns

Produce report-ready column names and order without changing any values.

~8 min read · beginner · Module 4: Working with columns

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

Before this: Choose Columns vs Remove Columns

Source systems name columns for programmers: CustID, ORD_DT, amt_usd. Reports need names people understand. Renaming changes no values, but it matters to everyone downstream, and it affects every later step that refers to the column.

Renaming

Double-click a header to rename it. Consecutive renames are recorded in one Table.RenameColumns step with a list of {old, new} pairs.

Choosing sets the order too

Dragging a header creates Table.ReorderColumns. But Table.SelectColumns already returns columns in the order you list them, so a select-then-rename pipeline usually needs no separate reorder step:

let
    Source = #table({"OrderID", "Customer", "Region", "Product", "Qty", "UnitPrice", "Status"}, {
        {"A-101", "Ana Ruiz", "North", "Kite", 2, 12.5, "Complete"},
        {"A-102", "Ben Okafor", "South", "Reel", 6, 4, "Cancelled"},
        {"A-103", "Cleo Park", "North", "Line", 4, 3.5, "Complete"},
        {"A-104", "Dev Shah", "West", "Kite", 1, 12.5, "Complete"}
    }),
    Kept = Table.SelectColumns(Source, {"OrderID", "Status", "Customer", "UnitPrice"}),
    Renamed = Table.RenameColumns(Kept, {{"OrderID", "Order Number"}, {"Customer", "Customer Name"}, {"UnitPrice", "Unit Price"}})
in
    Renamed

Result

Order NumberStatusCustomer NameUnit Price
A-101CompleteAna Ruiz12.5
A-102CancelledBen Okafor4
A-103CompleteCleo Park3.5
A-104CompleteDev Shah12.5

Output produced by the Power Query Exercises simulator, an independent implementation of a documented subset of M.

Reordering part of a table

When you don't want to drop anything, Table.ReorderColumns moves columns. You can list only some of them: columns you don't list stay exactly where they are, and the listed columns are rearranged, in your order, among the positions they occupied:

Table.ReorderColumns(
    #table({"Region", "OrderID", "Qty"}, {{"North", "A-101", 2}}),
    {"OrderID", "Region"}
)

Result

OrderIDRegionQty
A-101North2

Output produced by the Power Query Exercises simulator, an independent implementation of a documented subset of M.

Qty isn't listed, so it keeps position 3. To be certain of the final layout, list every column.

Where to rename

Later steps refer to the new names. If you rename a column after other steps already use it, those steps keep the old name and break the next time the query is edited. Two patterns avoid that: rename early, right after setting types, so every later step uses the friendly names; or rename at the very end as a presentation step, so all calculation steps use the source names. Mixing the two is what causes trouble.

Where to find this in Excel

Excel for Windows
Double-click a column header to rename it
What you see
The header becomes editable and the change is recorded as a Renamed Columns step.

Paths are for the Power Query editor in Excel for Microsoft 365, checked against Microsoft's documentation on 8 November 2026: Use Power Query to transform data (the Power Query editor) (Microsoft Learn); Applied steps (Microsoft Learn).

Common mistakes

  • A typo or wrong capitalisation in the old name, which raises The column … of the table wasn't found.
  • Renaming a column in the middle of a query, then referencing the old name in a later custom column.
  • Adding a separate reorder step after Choose Columns when the select list could set the order.

Excel, Power BI and the simulator

  • Excel and Power BI Desktop: double-click a header or press F2 to rename; drag headers to reorder. Both hosts merge consecutive renames into one step.
  • In Power BI, renaming in Power Query renames the field in the model. Renaming later in the report view creates a display name only for that visual.
  • The simulator supports both functions, including the optional MissingField argument.

Next step

Apply this lesson in the simulator. The exercise is checked against fresh data, so the query has to work for rows it hasn't seen. It's free, with no account needed.

Practise: Rename and reorder columns for a finance report (kite shop)

Practice this

Each exercise runs in the browser and is checked against fresh data, not just the example.