Forum Discussion
Merging Files with Fixed Set of Columns and Varied Date Columns (for unpivot)
- 6 years ago
Hi oxologic
You can use Get data from SharePoint folder
Then filter the Folder Path to select only the folder path with all the files in question.
Create a Blank Query and paste the below script into Advanced Editor to create Function and rename it to "Function".
( content as binary ) => let binaryToTable = Excel.Workbook( content ), getData = binaryToTable{ [Item="Table1", Kind="Table"] }[Data], unpivot = Table.UnpivotOtherColumns( getData, {"Supplier", "Product"}, "Date", "Value" ) in unpivotWhen in the table with a list of files, go to Add Column ribbon > Invoke Kustom Function and follow the below.
Now you can Expand all the columns from all files.
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Hi oxologic
Can you Provide samples for these files?
Mariusz
If this post helps, then please consider Accepting it as the solution.
Mariusz , hi i've attached the sample data files through wetransfer. I thought there was a way to attach the files previously, but couldn't find it.
- Mariusz6 years ago
Community Champion
Hi oxologic
You can use Get data from SharePoint folder
Then filter the Folder Path to select only the folder path with all the files in question.
Create a Blank Query and paste the below script into Advanced Editor to create Function and rename it to "Function".
( content as binary ) => let binaryToTable = Excel.Workbook( content ), getData = binaryToTable{ [Item="Table1", Kind="Table"] }[Data], unpivot = Table.UnpivotOtherColumns( getData, {"Supplier", "Product"}, "Date", "Value" ) in unpivotWhen in the table with a list of files, go to Add Column ribbon > Invoke Kustom Function and follow the below.
Now you can Expand all the columns from all files.
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.