Expansion of part/subpart "bill of material" list

Frequent Contributor

Attached an Excel file with the input and desired output. I suspect this would need a PowerQuery. (I would prefer not to use VBA since I have no knowledge of that). Many thanks in advance for any help provided.


Basically I have a Bill of Material list with 3 columns: Part, Subpart and "Qty of Subpart in Part". This is multiple level, so a Subpart in one row can come back as a Part in another row, and so on.

I need to expand that list so that all variations of relations are added (not only each time Part-Subpart, but also Part - SubSubPart, SubPart - SubSubSubPart, Part - SubSubSubPart etc.).


So from this:



which can be graphically represented like this:



I need to have an expanded version as output:


(view incomplete)


I think the Excel file will make things clear.


P.S. This question starts from the same input as my question from last year "Parent-child flattening (multiple levels)" but needs a different output.

0 Replies