Table.PromoteHeaders
Makes the first row the header: its values name the columns, and the row itself goes.
Group: Table. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Table.PromoteHeaders(table as table, optional options as nullable record) as table
| Parameter | Type | Description |
|---|---|---|
table | table | The table whose first row holds the names. |
options | nullable record optional | A record: PromoteAllScalars = true also promotes numbers, dates and logicals, written as text; Culture says how they are written. |
Returns
table. The rows after the first, the columns named from it.
Remarks
- By default only text is promoted: a number, a date or null in the first row leaves its column with a default name, such as Column3.
- Names that repeat get _1, _2 and so on added: two Sales columns become Sales and Sales_1.
- With
PromoteAllScalars, a date or number is written as the culture writes it: the optionCulture, else the query's (a date of 1 March 2026 names its column 3/1/2026 in en-US, 01.03.2026 in nb-NO). - Files without a header row come in as Column1, Column2 ...; Transform data adds this step, then Changed Type, when the first row holds the names.
Examples
Names from the first row
let
Raw = #table({"Column1", "Column2", "Column3"}, {{"Product", "Shop", "Sales"}, {"Chair", "Oslo", 120}, {"Desk", "Bergen", 340}})
in
Table.PromoteHeaders(Raw)
| Product | Shop | Sales |
|---|---|---|
| Chair | Oslo | 120 |
| Desk | Bergen | 340 |
Years as headers
The years are numbers: only PromoteAllScalars makes names of them.
let
Raw = #table({"Column1", "Column2", "Column3"}, {{"Product", 2025, 2026}, {"Chair", 10, 12}})
in
Table.PromoteHeaders(Raw, [PromoteAllScalars = true])
| Product | 2025 | 2026 |
|---|---|---|
| Chair | 10 | 12 |
A name used twice
Table.PromoteHeaders(#table({"Column1", "Column2", "Column3"}, {{"Product", "Sales", "Sales"}, {"Chair", 120, 130}}))
| Product | Sales | Sales_1 |
|---|---|---|
| Chair | 120 | 130 |
Related functions
Table.DemoteHeaders, Table.RenameColumns, Table.RemoveFirstN, Table.TransformColumnTypes.