Table.RenameColumns
This topic applies to the Power Query Formula Language which can be used with Power Query and Power BI Desktop to build queries that mashup data. See the list of function categories.
Returns a table with the columns renamed as specified.
Table.RenameColumns(table as table, renames as list, optional missingField as nullable number) as table
| Argument | Description |
|---|---|
| table | The Table to modify. |
| renames | The list of values to rename to. |
| optional missingField | The default value of missingField is MissingField.Error. For more information, see Parameter Values. |
- Table.RenameColumns is similar to Record.RenameFields applied to every row in a table.
Table.RenameColumns(Table.FromRecords({
[CustomerNum=1, Name="Bob", Phone = "123-4567"]}),
{"CustomerNum", "CustomerID"})
| CustomerID | Name | Phone |
|---|---|---|
| 1 | Bob | 123-4567 |
Table.RenameColumns(Table.FromRecords({
[CustomerID=1, Name="Bob", Phone = "123-4567"]}), {"NewCol", "NewColumn"}, MissingField.UseNull)
| CustomerID | Name | Phone | NewColumn |
|---|---|---|---|
| 1 | Bob | 123-4567 | null |
Show: