Forum Discussion

kk_shp_user's avatar
kk_shp_user
Helper I
2 years ago
Solved

Getting count per category in one column using data in another column

Edit: Simplified my example and description to make it easier to understand.

 

I have a data like below. The table contains employees and managers. Managers are also present as employee records.

 

I want to calculate the no. of emps per manager title. I am trying to populate the below table visual and am having a challenge in getting the highlighted value.

 

 

  • Hi kk_shp_user 

    Try using TREATAS 

    Total_Emps_at_Title =
    CALCULATE (
    COUNTROWS ( 'Table' ),
    TREATAS ( VALUES ( 'Table'[recruiter_title] ), 'Table'[emp_title] )
    )

4 Replies

  • tamerj1's avatar
    tamerj1
    Community Champion

    Hi kk_shp_user 

    Try using TREATAS 

    Total_Emps_at_Title =
    CALCULATE (
    COUNTROWS ( 'Table' ),
    TREATAS ( VALUES ( 'Table'[recruiter_title] ), 'Table'[emp_title] )
    )

    • kk_shp_user's avatar
      kk_shp_user
      Helper I

      Thanks for yourt reply but the solution did not get the expected result.