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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
joshua1990
Post Prodigy
Post Prodigy

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 1
tackytechtom
Super User
Super User

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/

 



Did I answer your question➡️ Please, mark my post as a solution ✔️

Also happily accepting Kudos 🙂

Feel free to connect with me on LinkedIn! linkedIn

#proudtobeasuperuser 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Kudoed Authors