Forum Discussion
Span of Control
- 8 years ago
You could simply add a new column with DAX:
Span of Control = VAR x = [Employee] RETURN CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( 'Table', x = [Manager] ) )You should change the 'Table' with your table name.
Edit: You may add a " + 0" after the "COUNTROWS(TABLE)" in order to not display null results
You could simply add a new column with DAX:
Span of Control =
VAR x = [Employee]
RETURN
CALCULATE ( COUNTROWS ( 'Table' ), FILTER ( 'Table', x = [Manager] ) )You should change the 'Table' with your table name.
Edit: You may add a " + 0" after the "COUNTROWS(TABLE)" in order to not display null results
Assuming your employees don't repeat, Smauro gave a better solution than I did. Kudos to him.
- Smauro8 years ago
Solution Sage
wwhittenton you are right, thank you!
I took it for certain that the employees would be unique.. If not, then your solution works better.- wwhittenton8 years ago
Helper II
Smauro In retrospect, that's the better (or perhaps only viable) assumption. If the employees are not unique, the span of control calculation comes out incorrect either way, because the manager an individual reports to would be double-counted even in the new table.
Thanks for the good wishes and happy holidays to you and to you as well, PauloH.
- Smauro8 years ago
Solution Sage
wwhittenton I think you're right. And there may be some people with more than one manager as well.
PauloH So, in case your Employee-Manager has duplicates, you should first go on Query Editor, Select both Employee and Manager columns and right click-> remove duplicates. And then, add the column I mentioned.Happy holidays to you too wwhittenton! And PauloH :)