Table.DemoteHeaders Function in Power Query

The Table.DemoteHeaders function demotes the header row i.e. the column names down into the first row of a table. The default column names are "Column1", "Column2" and so on.

Syntax

Table.DemoteHeaders(table as table) as table

Example: Demote the first row of values in the table.

Power Query M

let
  MyTable = Table.FromRecords(
    {
      [CustomerID = 1, Name = "Ashish", Marks = 568], 
      [CustomerID = 2, Name = "Katrina", Marks = 855], 
      [CustomerID = 3, Name = "Alia", Marks = 380], 
      [CustomerID = 4, Name = "Vicky", Marks = 458], 
      [CustomerID = 5, Name = "Mohini", Marks = 278], 
      [CustomerID = 6, Name = "Meenakshi", Marks = 289], 
      [CustomerID = 7, Name = "Esha", Marks = 875], 
      [CustomerID = 8, Name = "Anjali", Marks = 380]
    }
  ), 
  Return = Table.DemoteHeaders(MyTable)
in
  Return     

The output of the above formula is shown below:

Table.DemoteHeaders function in Power Query