Forum Discussion
MikeBlair
Apr 05, 2023Copper Contributor
Re-use headers from one sheet to another
I have an Excel where I want to combine the two using power query. This is very easy when the both sheets have the identical headers but sheet 2 has none. I can copy and paste the headers in and it...
SergeiBaklan
Apr 05, 2023Diamond Contributor
That could be like
// Query2
let
Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
names = Table.ColumnNames( Query1 ),
rename = Table.RenameColumns( Source, List.Zip( { Table.ColumnNames(Source), names } ) )
in
rename