Forum Discussion
TiZi08
3 years agoNew Member
Remove Rows & Use First Row as Headers for Specific Columns
Hi. I want to Remove Rows & then Use First Row as Headers for specific columns. Specifically, I want to apply this to all except two columns. I am working with messy data; at least the data is c...
wdx223_Daniel
3 years agoCommunity Champion
NewStep=let ColumnNamesYouWantKeep={"Col 1","Col6"},Rows=Table.ToRows(PreviousStepName) in #table(List.Transform(List.Zip({Table.ColumnNames(PreviousStepName),Rows{5},List.Positions(Rows{0})}),each if List.Contains(ColumnNamesYouWantKeep,_{0}) then _{0} else Text.From(_{1}??Number.ToText(_{2}+1,"Column_0")),List.Skip(Rows,6))