Forum Discussion
Eric_Zhang
Microsoft Employee
10 years ago
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])-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.
rebin40
8 years agoRegular Visitor
Where to enter the
CalculatedTable ?