Forum Discussion

kodnil2020's avatar
kodnil2020
Helper I
6 years ago
Solved

Diversity calculation

Hello,

 

Need help on calculation. 

Formula: (count of active female employees in Department / Total employees in department)*100

 

Data: 

DepartmentGenderID
Dept1Male11
Dept1Male12
Dept1Male13
Dept1Female14
Dept1Male15
Dept1Female16
Dept2Male17
Dept2Male18
Dept2Male19
Dept2Female20
Dept2Male21
Dept2Female22

 

IDActive
111
121
131
141
151
161
171
181
191
201
210
220

 

Result

Department% Diversity
Dept133
Dept225
  • kodnil2020 

    Try this Measure:

    Measure = 
    
    VAR _TotalEmployees = CALCULATE( COUNTROWS(Department),IDs[Active]=1)
    VAR _Female = 
    CALCULATE(
        COUNTROWS(Department),
        IDs[Active]=1,
        Department[Gender]="Female"
    )
    
    RETURN
    
    DIVIDE(
        _Female,
        _TotalEmployees
    )

     

    ________________________

    Did I answer your question? Mark this post as a solution, this will help others!.

    I accept KUDOS 🙂

    YouTube, LinkedIn

4 Replies

  • kodnil2020 , Try a new measure like

    divide(calculate(count(Table[ID]), Table[Gender]= "Female"),calculate(count(Table[ID])))

  • kodnil2020 

    Try this Measure:

    Measure = 
    
    VAR _TotalEmployees = CALCULATE( COUNTROWS(Department),IDs[Active]=1)
    VAR _Female = 
    CALCULATE(
        COUNTROWS(Department),
        IDs[Active]=1,
        Department[Gender]="Female"
    )
    
    RETURN
    
    DIVIDE(
        _Female,
        _TotalEmployees
    )

     

    ________________________

    Did I answer your question? Mark this post as a solution, this will help others!.

    I accept KUDOS 🙂

    YouTube, LinkedIn

    • kodnil2020's avatar
      kodnil2020
      Helper I

      It is taking Total Active instead of Total Department Active.

      One more query: How can i show Avergage at the bottom:

       

      Department% Diversity
      Dept133
      Dept225
      Average29