I want to iterate a merging function in PowerQuery over each column. I have a dataset where each column has references to 3 datapoints in another dataset. dataset1 BA005 for example refers to a total of 15 datapoints in the other dataset.The other dataset contains the following: dataset I want my output to look like the following: desired output I can do it manually, but I have over 99 columns in my dataset, so I would rather not.
I've tried to make a function based on this Power Query Applying a Function Across Every Column but I'm very new to coding functions in PowerQuery so I do not know if it's even possible. Any help or references to guides would be helpful as I do not know where to start.
The code of the manual merge is:
#"Merged Queries" = Table.NestedJoin(#"Changed Type", {"BA005"}, Format2, {"Account Number"}, "BA005.", JoinKind.LeftOuter),
#"Expanded BA005." = Table.ExpandTableColumn(#"Merged Queries", "BA005.", {"Total of reporting period", "Total of the comparison period", "Absolute difference"}, {"BA005..Total of reporting period", "BA005..Total of the comparison period", "BA005..Absolute difference"}),
#"Merged Queries2" = Table.NestedJoin(#"Expanded BA005.", {"BA009"}, Format2, {"Account Number"}, "BA009.", JoinKind.LeftOuter),
#"Expanded BA009." = Table.ExpandTableColumn(#"Merged Queries2", "BA009.", {"Total of reporting period", "Total of the comparison period", "Absolute difference"}, {"BA009..Total of reporting period", "BA009..Total of the comparison period", "BA009..Absolute difference"})
