Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Recursive function in Power Query

I have a table that I need to expand possibly by using recursion in M language for Power BI report.

 

Each ID is contained in multiple Keys and each Key could contain multiple IDs. I need to expand this table with new columns to traverse so that for each Key I list all IDs that are related to it. This should go back and forth between ID and Key columns placing ID and Key values in new columns until traversing reaches the end, because there are so many ID and Key combinations.

 

This problem is too advanced for me so I need help solving it.

 

PixelatedFern_0-1671709346492.png

 

1 ACCEPTED SOLUTION
ppm1
Solution Sage
Solution Sage

Please see this article with M code that does what I think you are describing.

Guest Post: Using List.Accumulate for Input/Output Genealogy – The BIccountant

 

Pat

 

Microsoft Employee

View solution in original post

1 REPLY 1
ppm1
Solution Sage
Solution Sage

Please see this article with M code that does what I think you are describing.

Guest Post: Using List.Accumulate for Input/Output Genealogy – The BIccountant

 

Pat

 

Microsoft Employee

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors