Forum Discussion
fsim
6 years agoResponsive Resident
table.ExpanTableColumn with changing columns' names
hi there, Every month I get a brunch of 20 xls files containing 12+ columns. The name of those columns changed every month (typically previous 5 months, current month, next 6 months ) . How can I us...
- 6 years ago
Hi fsim
Please, see the attached file with a solution, it will look at all the column names within the tables and use this as a list to expand columns
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Jimmy801
6 years agoCommunity Champion
Hello fsim
use this codesnippet to understand how to build your Table.ExpandColumn dynamically.
ExpandAllColumns = Table.ExpandTableColumn
(
PreviousStep,
"ColumnToBeExpanded",
List.Union
(
List.Transform
(
List.Buffer(PreviousStep[ColumnToBeExpanded]), each Table.ColumnNames
(
_
)
)
)
)
in
ExpandAllColumns
If this post helps or solves your problem, please mark it as solution.
Kudos are nice to - thanks
Have fun
Jimmy