Table.DemoteHeaders
Moves the column names down into a first row and names the columns Column1, Column2 and so on.
Group: Table. Power Query M has it too: a query that uses it is written as in Power BI.
Syntax
Table.DemoteHeaders(table as table) as table
| Parameter | Type | Description |
|---|---|---|
table | table | The table whose names go into the rows. |
Returns
table. One more row than before, with the old names as its texts.
Remarks
- The opposite of
Table.PromoteHeaders. Often done beforeTable.Transpose, so that the names travel with the data.
Examples
Names into the first row
Table.DemoteHeaders(#table({"Product", "Price"}, {{"Chair", 50}, {"Desk", 120}}))
| Column1 | Column2 |
|---|---|
| Product | Price |
| Chair | 50 |
| Desk | 120 |