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  

ArgumentDescription
tableThe Table to modify.
renamesThe list of values to rename to.
optional missingFieldThe 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"})  

CustomerIDNamePhone
1Bob123-4567
Table.RenameColumns(Table.FromRecords({  
  
    [CustomerID=1, Name="Bob", Phone = "123-4567"]}), {"NewCol", "NewColumn"}, MissingField.UseNull)  

CustomerIDNamePhoneNewColumn
1Bob123-4567null
Show: