Forum Discussion
vsatamraju
Microsoft Employee
10 years agoCreating 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 t...
vsatamraju
Microsoft Employee
10 years agoI am looking top show the count
vsatamraju
Microsoft Employee
10 years agoSorry ,its a type mistake.
We are looing for Count of employees under each manager direct and indirect reportees.
Thanks in Advance
- Eric_Zhang10 years ago
Microsoft Employee
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.
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])-1You 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.
- vsatamraju10 years ago
Microsoft Employee
- efglynn9 years ago
Advocate IV
Where does this code go?
- remig9 years agoFrequent Visitor
Thanks a lot Eric, this has solved my problem. I wouldn't have been able to do it without this post; kudos.