Forum Discussion
using index columns to combine data from two tables
- Anonymous4 years ago
Hi Anonymous ,
I think you can add a custom column in Table A by this code in Power Query Editor.
Index = {Number.From([Index Start]) .. if [Index End] = null then List.Max(#"Table B"[Index]) else Number.From([Index End])}Then expand Index in Table A.
And then merge Table A and Table B by Index columns.
For reference: merge-queries-overview
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
You will need to pivot table A to then join to table B, so the results look like this:
User_ID, Index
4383961,3
4383961,4
4383961,5
4383961,6
4383961,7
4383961,8
4383961,9
I have seen this done in Power Query, but my Google-Foo failed me for an example.
Your biggest challenge will be getting the right # of records to fill in for table A.
After you get the right num of columns, go to 'column by example' to figure it out how to fill in the missing values for the index.
Power BI- Column From Example. In this article, we learn about the⦠| by Vaishali Goilkar | Medium
I hope this helps. Good luck.