Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
Need help on calculation.
Formula: (count of active female employees in Department / Total employees in department)*100
Data:
| Department | Gender | ID |
| Dept1 | Male | 11 |
| Dept1 | Male | 12 |
| Dept1 | Male | 13 |
| Dept1 | Female | 14 |
| Dept1 | Male | 15 |
| Dept1 | Female | 16 |
| Dept2 | Male | 17 |
| Dept2 | Male | 18 |
| Dept2 | Male | 19 |
| Dept2 | Female | 20 |
| Dept2 | Male | 21 |
| Dept2 | Female | 22 |
| ID | Active |
| 11 | 1 |
| 12 | 1 |
| 13 | 1 |
| 14 | 1 |
| 15 | 1 |
| 16 | 1 |
| 17 | 1 |
| 18 | 1 |
| 19 | 1 |
| 20 | 1 |
| 21 | 0 |
| 22 | 0 |
Result
| Department | % Diversity |
| Dept1 | 33 |
| Dept2 | 25 |
Solved! Go to Solution.
@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 🙂
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@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 🙂
⭕ 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 |
| Dept1 | 33 |
| Dept2 | 25 |
| Average | 29 |
@kodnil2020 , Try a new measure like
divide(calculate(count(Table[ID]), Table[Gender]= "Female"),calculate(count(Table[ID])))
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 38 | |
| 36 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 129 | |
| 88 | |
| 79 | |
| 68 | |
| 63 |