Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin 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.
@Time-intelligence
I need to calculate active headcount at end of any given month chosen dynamically by the user.
I calculate basis - LWD is less than or equal to the month end date and date of Joing should be less than or equal to that month
for the sample format attached,
Assuming this data was as on 01-May-2023
Active count by end of April month is 7
Active count by end of March month is 11
Can someone guide with the related DAX queries plz
Hi @VaibhaviShah_9 - Hope you already created a seperate date table in your model. give the relationship with Date table to model of employee table date.
you can try the below dax formuale to get the active head count
ActiveHeadcount =
VAR SelectedMonthEnd = MAX('DateTable'[MonthEnd])
RETURN
CALCULATE(
COUNTROWS('EmployeeData'),
'EmployeeData'[DateOfJoining] <= SelectedMonthEnd,
'EmployeeData'[LastWorkingDate] > SelectedMonthEnd || ISBLANK('EmployeeData'[LastWorkingDate])
)
you can see the Active count for each of the month end.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Proud to be a Super User! | |
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 78 | |
| 46 | |
| 37 | |
| 31 | |
| 26 |