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

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.

Reply
VaibhaviShah_9
New Member

Assistance with Time intelligence functions

@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 

 

sample format.PNG

 

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 

 

 

1 REPLY 1
rajendraongole1
Super User
Super User

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.

 

 

rajendraongole1_0-1719119714957.png

 

 

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!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.