Table.PromoteHeaders Function in Power Query
The Table.PromoteHeaders function promotes the first row of the table into its header or column names.
Syntax
Table.PromoteHeaders(table as table, optional options as nullable record) as table
Example: Promote the first row of values in the table.
Power Query M
let MyTable = Table.FromRecords( { [Name = "Employee Name", Phone = "Contact", Company = "Organization"], [Name = "Katrina", Phone = "987-6543", Company = "TCS"], [Name = "Alia", Phone = "543-7890", Company = "TCS"], [Name = "Vicky", Phone = "676-8479", Company = "TCS"], [Name = "Mohini", Phone = "574-8864", Company = "TCS"], [Name = "Meenakshi", Phone = "574-8864", Company = "TCS"], [Name = "Esha", Phone = "574-8864", Company = "TCS"], [Name = "Anjali", Phone = "574-8864", Company = "TCS"] } ), Return = Table.PromoteHeaders(MyTable) in Return
The output of the above code is shown below: