Table.DemoteHeaders
TableMoves the column headers down into the first row of data, replacing them with default column names.
Syntax
Table.DemoteHeaders(table as table) as tableParameters
| Name | Type | Required | Description |
|---|---|---|---|
table | table | Yes | The table whose headers should be demoted. |
Return Value
table — The table with previous column names as the first data row and default column names (Column1, Column2, …) as the new headers.
Remarks
Table.DemoteHeaders is the inverse of Table.PromoteHeaders. It is useful when you need to prepend the current column names as a data row — for example, before combining tables with different headers into a single flat list, or before pivoting/reshaping data where the headers themselves are values.
After demotion, columns are named Column1, Column2, etc.
Examples
Example 1: Demote headers to prepare for header-as-data reshaping
let
Source = #table({"Name", "Q1", "Q2"}, {{"Alice", 100, 200}, {"Bob", 150, 250}}),
Demoted = Table.DemoteHeaders(Source)
in
DemotedApplied Steps
The final output — moves the column headers (Name, Q1, Q2) into the first data row and renames all columns to Column1, Column2, Column3.
Column1 | Column2 | Column3 | |
|---|---|---|---|
| 1 | Name | Q1 | Q2 |
| 2 | Alice | 100 | 200 |
| 3 | Bob | 150 | 250 |
Example 2: Round-trip — demote then re-promote
let
Source = #table({"City","Sales"}, {{"New York", 500}, {"Chicago", 300}}),
Demoted = Table.DemoteHeaders(Source),
Promoted = Table.PromoteHeaders(Demoted)
in
PromotedCompatibility
✓ Power BI Desktop✓ Power BI Service✓ Excel Desktop✓ Excel Online✓ Dataflows✓ Fabric Notebooks