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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
vsatamraju
Microsoft Employee
Microsoft Employee

Creating a Hierarchy in Power BI

Hi All,

 

We are Clustered Column Chart in Power BI.

We are implementing the drill down feature for employee heirarchy from top to bottom according to the Organization depth. Now we want to show the Count of direct as well as indirect for each manager.

 

How can we do this ?

 

Thanks in Advance

11 REPLIES 11
Habib
Continued Contributor
Continued Contributor

You need help regarding hierarchy creation or to show the count for direct/indirect?

vsatamraju
Microsoft Employee
Microsoft Employee

I am looking top show the count 

Sorry ,its a type mistake.

 

We are looing for Count of employees under each manager direct and indirect reportees.

 

Thanks in Advance

@vsatamraju

 

Suppose the dataset is as the 3 columns highlighted. Create a calculated column [path] and table [calculatedTable] as below. Then use a measure subordinates in the chart.


Capture.PNG

path = PATH(Employees[Name],Employees[Parent])

CalculatedTable =
FILTER (
    CROSSJOIN (
        FILTER (
            ALL ( Employees[Name], Employees[Title] ),
            Employees[Title] = "manager"
        ),
        ALL ( Employees[path] )
    ),
    PATHCONTAINS ( Employees[path], Employees[Name] )
)

subordinates = COUNTA(CalculatedTable[path])-1

You can check more details in the attached pbix. Also check Understanding Functions for Parent-Child Hierarchies in DAX.

 

If it solves your problem, please accept it as solution. For any question, feel free to let me know.

Where to enter the 

CalculatedTable ?

 

Hi Eric, 

 

Thank you for this interesting piece of code; however, where do you enter the code for calculatedtable? 

Hi Eric, 

 

Thank you for this interesting piece of code; however, where do you enter the code for calculatedtable? 

@Eric_Zhang

Thanks a lot Eric, this has solved my problem. I wouldn't have been able to do it without this post; kudos.

Where does this code go?

@Eric_Zhang ,

 

I havent start this, i will let you know once i started.

ankitpatira
Community Champion
Community Champion

@vsatamraju to be able to create drill down in power bi visuals you need to drop multiple fields into Axis area. provided you have columns of organisational level, manager and count of employees you can use Pivot column feature in query editor in power bi desktop to seperate out organisational level as individual columns. you can then drop those fields into Axis area and count of employees onto Value area. 

 

The way you operate this depends on the structure of your data.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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