Forum Discussion
COUNT Parent-Child Hierarchy Level
Hi experts!
I have a table that contains two columns:
- Parent
- Child
This table demonstrates a multi-level parent-child hierarchy.
Now I would like to determine, how many levels are above and below every combination and if is the last oder lowest "leaf" in the combination.
How would you do that in Power Query?
1 Reply
- tackytechtom
Most Valuable Professional
Hi joshua1990 ,
I actually have just published a blog post providing a suggestion on how to deal with parent-child tables in Power Query. The post still needs some refining, but I thought I'll release it already now, so you can take a glimpse at it.
Depending on how your table exactly looks like, you might actually be able to use the functions in paragraph 3 from this article:
https://www.tackytech.blog/how-to-dynamically-detangle-parent-child-tables-in-power-query/
It won't give you exactly what you asked for, but it might provide you with some inspiration on how to fix it yourself.
Feel free to provide your parent-child table, if the functions hickup!
[Edit]: Here another article that tackles the same issue, but does a better job 🙂
Dynamically flatten Parent-Child Hierarchies in DAX and PowerBI – (thebiccountant.com)/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/