Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
kodnil2020
Helper I
Helper I

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
1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@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

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

4 REPLIES 4
Fowmy
Super User
Super User

@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

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

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

 

@Fowmy  Its working for me. Please ignore earlier comments

amitchandak
Super User
Super User

@kodnil2020 , Try a new measure like

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.