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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
HRAnaly123
Frequent Visitor

Human Resources - Head Count with Date Comparison

Hi Team, 

 

I have a rolling Head Count Formula that calculates the total number of active staff at any given Date. 


What I would like to do is compare the Head Counts for two different date peroids. 

 

Example, the total Head Count at 01/01/2023 & 01/01/2022, so I can identify differences between each year/month. 

 

Outcome Example below, I would ideally, like this in a Table. 

Division | 2024 Count | 2023 Count | People Growth % 

Risk       | 36               | 42                 | 6% 
Finance  | 27               | 25                | -2% 

 

My rolling Head Count:

RollingHC = CALCULATE(DISTINCTCOUNT(ADP_CurrentActive[EMP_CODE]),
    FILTER( VALUES( 'ADP_CurrentActive'[Hire Date]), ADP_CurrentActive[Hire Date] <= MAX( DATETABLE_DIM[Date] ) ),
    FILTER( VALUES( ADP_CurrentActive[TERM_DATE]), OR( 'ADP_CurrentActive'[TERM_DATE] >= MIN( DATETABLE_DIM[Date]), ISBLANK( 'ADP_CurrentActive'[TERM_DATE]))))
 
The Data Model is very simple,

Employee Data Table: 
 
Employee ID | Division | Hire Date     | Termination Date
1123              | Finance | 01/01/2021 | 30/01/2024
1771              | Finance | 01/01/2021 | [Blank]

Date Table: 

Date | Year | Month | Quater. 

Model Relationships:
Both Hire Date and Termination Date, have relationships to the Date Table. 

3 REPLIES 3
talespin
Solution Sage
Solution Sage

hi @HRAnaly123 

"Example, the total Head Count at 01/01/2023 & 01/01/2022, so I can identify differences between each year/month."

Sorry I couldn't figure out the logic for using just any date/month/year.  Below solution does it for CurrentYear Vs Previous Year. If you can share more example to help me understand what you want to do.

 

I have only one relationship active betwene Calendar and Employee table on HireDate(One to many, single direction)

 

 

 

 

Measure1

------------

Active Employee Count =
VAR _Date = CALCULATE(MAX('CALENDAR'[Date]) )

RETURN CALCULATE( COUNT(Employee[EmployeeID]), 'CALENDAR'[Date] <= _Date, ISBLANK(Employee[TerminationDate]) || Employee[TerminationDate] > _Date )
 
Measure2
--------------
People Growth =
VAR _Year = SELECTEDVALUE('CALENDAR'[YEAR])
VAR _PreviousYear = _Year - 1
VAR _CurrentYrCount = CALCULATE( COUNT(Employee[EmployeeID]), 'CALENDAR'[YEAR] <= _Year, ISBLANK(Employee[TerminationDate]) || YEAR(Employee[TerminationDate]) > _Year )
VAR _PreviousYrCount = CALCULATE( COUNT(Employee[EmployeeID]), 'CALENDAR'[YEAR] <= _PreviousYear, ISBLANK(Employee[TerminationDate]) || YEAR(Employee[TerminationDate]) > _PreviousYear )

RETURN DIVIDE( (_CurrentYrCount - _PreviousYrCount), _PreviousYrCount)
 
talespin_0-1708423069195.png

 

 Sample data I used
EmployeeIDDivisionHireDateTerminationDate
1Finance2023-01-052023-01-05
2HR2023-03-15 
3IT2023-06-282024-01-15
4Finance2023-08-15 
5HR2023-05-222023-05-22
6IT2023-10-16 
7Finance2023-11-152023-11-15
8HR2023-12-24 
9IT2024-01-062024-01-06
10Finance2024-02-062024-02-06
11HR2024-01-19 
12IT2024-01-222024-01-22
13Finance2023-09-062023-09-06
14IT2023-08-14 
15HR2023-07-112023-07-11
16Finance2023-10-11 
17HR2023-04-062023-04-06
18IT2023-01-052024-01-15
19HR2023-03-152024-01-15
20Finance2023-06-282024-01-15
talespin
Solution Sage
Solution Sage

hi @HRAnaly123 

 

Please share some sample date or pbix file with any sensitive information removed, along with information on how your data model is setup.

Hi Talespin, 

I ammended my original post to cover your requriements. 

Thank you

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.