Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
I have prepared a measure, which counts the cumulative number of employees for a given date. It takes into consideration "Date of employment" and "Date of dismissal". The table contains each employee no. together with the above dates.
The measure works as expected.
Active employees =
CALCULATE (
COUNTROWS (
FILTER (
'Employees',
'Employees'[Date of employment] <= MAX ( 'Calendar'[Date] )
&& (
ISBLANK ( 'Employees'[Date of dismissal] )
|| 'Employees'[Date of dismissal] > MAX ( 'Calendar'[Date] )
)
)
),
FILTER (
ALLSELECTED ( 'Calendar'[Date] ),
'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
)
)
Then I wanted to create a measure calculating no. of active female employees, so I used the above measure in my new measure:
No. of female employees =
CALCULATE (
[Active Employees],
FILTER ( 'Employees', Employees[Gender] = "Female" )
)
It doesn't work though as expected and gives only the number of female in selected date/period (not cumulative).
Does anybody know why?
When I adjust the first measure with the last filter it works fine.
Active Female employees =
CALCULATE (
COUNTROWS (
FILTER (
'Employees',
'Employees'[Date of employment] <= MAX ( 'Calendar'[Date] )
&& (
ISBLANK ( 'Employees'[Date of dismissal] )
|| 'Employees'[Date of dismissal] > MAX ( 'Calendar'[Date] )
)
)
),
FILTER (
ALLSELECTED ( 'Calendar'[Date] ),
'Calendar'[Date] <= MAX ( 'Calendar'[Date] )
),
Employees[Gender] = "Female"
)
Thanks!
Solved! Go to Solution.
Refer if this can help
HR-Analytics-Active-Employee-Hire-and-Termination-trend
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin
Refer if this can help
HR-Analytics-Active-Employee-Hire-and-Termination-trend
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
81 | |
75 | |
60 | |
37 | |
33 |
User | Count |
---|---|
102 | |
56 | |
52 | |
45 | |
40 |