Forum Discussion

Gandhi's avatar
Gandhi
Frequent Visitor
1 year ago
Solved

Power Query Use First Row as Headers for selected (or single) Row(s)

Hello folks, How do I can promote for example 3 out of 10 or 1 out of 50 etc. rows to header? When I have a situation where I don't want promote every rows (they have their correct headers already...
  • Gandhi's avatar
    Gandhi
    1 year ago

    I agree. It is amazing how this community works. 

    I didn't see any of those answers as a solution for my problem. I did it like this:

    #"Promoted Headers Conditionally" = Table.TransformColumns(
    #"Added Custom",
    {
    "Data",
    each
    if List.First(Table.ColumnNames(_)) = "Column1" then
    Table.PromoteHeaders(_, [PromoteAllScalars=true])
    else
    _
    }