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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Automate a hierarchy with increasing levels

Hello,

I have some issues with automating a tree hierarchy. I don’t know the final level of the hierarchy, so I need it fully automated. Given a set of data:

Data_Example_Hierarchy.PNG

 

I found a lot of solutions where I can manually get the hierarchy in a column schema and use it with a DAX expression to prepare and use the date like this:

Column_Prep_And_Drilldown.PNG

But I have now 2 open struggles: First of all I have currently 23 levels(!) and they will continue to grow. So this should be fully automated without the need of knowing the amount of levels before. And I need to display measures for every ID. Which leads me to my main questions:

 

  1. Preparing the hierarchy to a drilldown capable format. I get the data from a SQL CTE, should I get it from there in a column schema? Or is there a viable solution in PowerBI to get It done automatically?
  2. If a new level rises, and I managed to get the preparation automated, I need to integrate the new column (level) automatically in the drilldown hierarchy for a matrix. How can I manage this?

Thank you in advance!

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Have you already tried path , pathitem etc

https://radacad.com/parsing-organizational-hierarchy-or-chart-of-accounts-in-power-bi-with-parent-child-functions-in-dax

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 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 Solution Authors