Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

DAX help for calculating head count.

Hi experts,
Please help


Need to calculate headcount based on the manager and director tags.
If the employee is either a manager or director, then we need to calculate the number of employees allocated to him.

Input   
Employee IDDesignationDirector IDManager ID
1Supervisor43
2Supervisor43
3Manager 5 
4Director  
5Director  

 

Output 
Employee IDHeadcount
32
42
51

6 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      ryan_mayu 
      Can you please consider below data for calculation

      Emp IDManager IDDirector ID
      A16A23A49
      A23A13A49
      A13A23A16
      A89A23A16
      A76A23A16
      A49A23A16
      A13A23A16
      A54A23A16
      A13A23A16
      A55A23A16
      A02A23A16
      A36A23A16
  • Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Ahmedx ,

      Can you please consider below data for calculation. I am getting some errors in the formula.

      Emp IDManager IDDirector ID
      A16A23A49
      A23A13A49
      A13A23A16
      A89A23A16
      A76A23A16
      A49A23A16
      A13A23A16
      A54A23A16
      A13A23A16
      A55A23A16
      A02A23A16
      A36A23A16