Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hi,
I have three columns in my table - EmpID, Supervisor and Level. I need to find out count of number of direct reports for a particular EmpID using the Supervisor column but only for the Leader, Manager and Director levels. The count of number of direct reports should be populated in a new column (CountofDirectReports). I highlighted CountofDirectReports column in yellow where the count needs to go. I working to figure it out using DAX but could not figure it out. Can someone please help?
Here is the sample data as an example:
Thanks for your help!
Solved! Go to Solution.
Hello @Anonymous
You can use a measure like so to add a calculated column to your table:
DirectReports = VAR CurrentEmp = 'Table'[EmpID] RETURN CALCULATE( COUNTROWS('Table'), ALL('Table'), 'Table'[Supervisor] = CurrentEmp )
Hello @Anonymous
You can use a measure like so to add a calculated column to your table:
DirectReports = VAR CurrentEmp = 'Table'[EmpID] RETURN CALCULATE( COUNTROWS('Table'), ALL('Table'), 'Table'[Supervisor] = CurrentEmp )
This worked. Thank you for your help!
User | Count |
---|---|
123 | |
69 | |
67 | |
58 | |
52 |
User | Count |
---|---|
183 | |
92 | |
67 | |
62 | |
53 |