Forum Discussion
Liam01
2 years agoHelper I
Combine multiple sheets with the same table but with different columns
Hello all, I'm trying to create a Dataflow to combine multiple Excel spreadsheets where there is a defined table - InputSheet - but the number of columns and the order of the columns is different...
Liam01
2 years agoHelper I
Thanks. I've tried that but it doesn't show all the columns, it only appears to show the ones that are on the sample file? Which is the same as when I use the button next to Content.
I need to see all the different columns from all the sheets.
dufoq3
2 years agoCommunity Champion
at the beginning backup your code or whole excel file (just for sure).
I recommend you to use Transform Data when you use From Folder
Then you can filter files:
Then in step of combining files do not select sheet directly but use it this way:
Open Transform Sample File in Advanced editor, delete whole code and paste ther this one:
let
Source = Excel.Workbook(Parameter1, true, true),
#"Added Custom" = Table.AddColumn(Source, "Custom", each Table.Combine(Source[Data])),
#"Removed Other Columns" = Table.SelectColumns(#"Added Custom",{"Custom"})
in
#"Removed Other Columns"
Now you should be able expand columns: