Case 2: new hires and leavers
Who joined, who left? Two measures count the people whose hire date or leave date falls in the period of the cell, whether the row is a year, a quarter or a month.
In short: MIN('Date'[Date]) and MAX('Date'[Date]) return the start and end of the period in the filter. COUNTROWS(FILTER(Employee, Employee[HireDate] >= MIN('Date'[Date]) && Employee[HireDate] <= MAX('Date'[Date]))) counts the new hires in it, with the LeaveDate column the leavers.
Task 1: new hires
Task Create the measure "New Hires": the number of people whose hire date falls in the period of the cell, that is between the first and the last day in the date table filter.
Employee 46 rows, 8 columns
| EmployeeID | Name | DepartmentID | HireDate | LeaveDate | Salary | EmploymentType | Status |
|---|---|---|---|---|---|---|---|
| 101 | Sophie Lang | 1 | 1 Oct 2020 | 51500 | Full-time | Active | |
| 102 | Noah Walker | 1 | 1 Nov 2025 | 29600 | Part-time | Active | |
| 103 | Sophie Hayes | 1 | 1 Sep 2026 | 54100 | Full-time | Active | |
| 104 | Sam Price | 1 | 1 Aug 2024 | 60300 | Full-time | Active | |
| 105 | Ben Price | 1 | 1 Mar 2018 | 31 May 2026 | 66600 | Full-time | Left |
| 106 | Olivia Hughes | 1 | 1 Apr 2020 | 66000 | Full-time | Active | |
| 107 | Ben Bennett | 2 | 1 Nov 2012 | 44000 | Part-time | Active | |
| 108 | Jack Hughes | 2 | 1 Feb 2016 | 47600 | Full-time | Active | |
| 109 | Ben Hayes | 2 | 1 Apr 2021 | 31 Aug 2025 | 51000 | Full-time | Left |
| 110 | Lucy Clarke | 2 | 1 Oct 2019 | 57700 | Full-time | Active | |
| 111 | Ravi Ali | 2 | 1 Jul 2022 | 31 Mar 2025 | 48700 | Full-time | Left |
| 112 | Ben Foster | 2 | 1 Mar 2019 | 52100 | Full-time | Active |
Showing the first 12 of 46 rows.
Department 6 rows, 3 columns
| DepartmentID | Department | Division |
|---|---|---|
| 1 | Administration | Administration |
| 2 | Sales | Sales |
| 3 | Production | Operations |
| 4 | Logistics | Operations |
| 5 | IT | Administration |
| 6 | Customer Service | Sales |
Absence 486 rows, 5 columns
| AbsenceID | Date | EmployeeID | Type | Days |
|---|---|---|---|---|
| 1 | 1 Jan 2025 | 111 | Sick leave | 2 |
| 2 | 2 Jan 2025 | 101 | Vacation | 9 |
| 3 | 3 Jan 2025 | 127 | Sick leave | 4 |
| 4 | 3 Jan 2025 | 127 | Sick leave | 10 |
| 5 | 4 Jan 2025 | 142 | Sick leave | 2 |
| 6 | 6 Jan 2025 | 104 | Sick leave | 4 |
| 7 | 6 Jan 2025 | 118 | Vacation | 3 |
| 8 | 7 Jan 2025 | 124 | Sick leave | 4 |
| 9 | 7 Jan 2025 | 134 | Vacation | 6 |
| 10 | 12 Jan 2025 | 113 | Vacation | 7 |
| 11 | 15 Jan 2025 | 115 | Sick leave | 4 |
| 12 | 16 Jan 2025 | 117 | Sick leave | 2 |
Showing the first 12 of 486 rows.
Measures: [Absence Days]
Date 730 rows, 4 columns
| Date | Year | Month | MonthName |
|---|---|---|---|
| 1 Jan 2025 | 2025 | 1 | Jan |
| 2 Jan 2025 | 2025 | 1 | Jan |
| 3 Jan 2025 | 2025 | 1 | Jan |
| 4 Jan 2025 | 2025 | 1 | Jan |
| 5 Jan 2025 | 2025 | 1 | Jan |
| 6 Jan 2025 | 2025 | 1 | Jan |
| 7 Jan 2025 | 2025 | 1 | Jan |
| 8 Jan 2025 | 2025 | 1 | Jan |
| 9 Jan 2025 | 2025 | 1 | Jan |
| 10 Jan 2025 | 2025 | 1 | Jan |
| 11 Jan 2025 | 2025 | 1 | Jan |
| 12 Jan 2025 | 2025 | 1 | Jan |
Showing the first 12 of 730 rows.
The period comes from the filter context of the cell, as in the lesson on filter context. Here it is the year 2026 from the slicer; the department in the row filters the people through the relationship.
Task 2: leavers
Task Create the measure "Leavers": the number of people whose leave date falls in the period of the cell. The matrix shows both years side by side with the new hires.
Employee 46 rows, 8 columns
| EmployeeID | Name | DepartmentID | HireDate | LeaveDate | Salary | EmploymentType | Status |
|---|---|---|---|---|---|---|---|
| 101 | Sophie Lang | 1 | 1 Oct 2020 | 51500 | Full-time | Active | |
| 102 | Noah Walker | 1 | 1 Nov 2025 | 29600 | Part-time | Active | |
| 103 | Sophie Hayes | 1 | 1 Sep 2026 | 54100 | Full-time | Active | |
| 104 | Sam Price | 1 | 1 Aug 2024 | 60300 | Full-time | Active | |
| 105 | Ben Price | 1 | 1 Mar 2018 | 31 May 2026 | 66600 | Full-time | Left |
| 106 | Olivia Hughes | 1 | 1 Apr 2020 | 66000 | Full-time | Active | |
| 107 | Ben Bennett | 2 | 1 Nov 2012 | 44000 | Part-time | Active | |
| 108 | Jack Hughes | 2 | 1 Feb 2016 | 47600 | Full-time | Active | |
| 109 | Ben Hayes | 2 | 1 Apr 2021 | 31 Aug 2025 | 51000 | Full-time | Left |
| 110 | Lucy Clarke | 2 | 1 Oct 2019 | 57700 | Full-time | Active | |
| 111 | Ravi Ali | 2 | 1 Jul 2022 | 31 Mar 2025 | 48700 | Full-time | Left |
| 112 | Ben Foster | 2 | 1 Mar 2019 | 52100 | Full-time | Active |
Showing the first 12 of 46 rows.
Measures: [New Hires]
Department 6 rows, 3 columns
| DepartmentID | Department | Division |
|---|---|---|
| 1 | Administration | Administration |
| 2 | Sales | Sales |
| 3 | Production | Operations |
| 4 | Logistics | Operations |
| 5 | IT | Administration |
| 6 | Customer Service | Sales |
Absence 486 rows, 5 columns
| AbsenceID | Date | EmployeeID | Type | Days |
|---|---|---|---|---|
| 1 | 1 Jan 2025 | 111 | Sick leave | 2 |
| 2 | 2 Jan 2025 | 101 | Vacation | 9 |
| 3 | 3 Jan 2025 | 127 | Sick leave | 4 |
| 4 | 3 Jan 2025 | 127 | Sick leave | 10 |
| 5 | 4 Jan 2025 | 142 | Sick leave | 2 |
| 6 | 6 Jan 2025 | 104 | Sick leave | 4 |
| 7 | 6 Jan 2025 | 118 | Vacation | 3 |
| 8 | 7 Jan 2025 | 124 | Sick leave | 4 |
| 9 | 7 Jan 2025 | 134 | Vacation | 6 |
| 10 | 12 Jan 2025 | 113 | Vacation | 7 |
| 11 | 15 Jan 2025 | 115 | Sick leave | 4 |
| 12 | 16 Jan 2025 | 117 | Sick leave | 2 |
Showing the first 12 of 486 rows.
Measures: [Absence Days]
Date 730 rows, 4 columns
| Date | Year | Month | MonthName |
|---|---|---|---|
| 1 Jan 2025 | 2025 | 1 | Jan |
| 2 Jan 2025 | 2025 | 1 | Jan |
| 3 Jan 2025 | 2025 | 1 | Jan |
| 4 Jan 2025 | 2025 | 1 | Jan |
| 5 Jan 2025 | 2025 | 1 | Jan |
| 6 Jan 2025 | 2025 | 1 | Jan |
| 7 Jan 2025 | 2025 | 1 | Jan |
| 8 Jan 2025 | 2025 | 1 | Jan |
| 9 Jan 2025 | 2025 | 1 | Jan |
| 10 Jan 2025 | 2025 | 1 | Jan |
| 11 Jan 2025 | 2025 | 1 | Jan |
| 12 Jan 2025 | 2025 | 1 | Jan |
Showing the first 12 of 730 rows.
This exercise is part of Premium.
Premium unlocks every exercise in every lesson, unlimited practice with fresh tasks and the final test with certificate.
See Premium Already Premium? Log in
The first exercise in this lesson is free.
With new hires and leavers side by side you can see whether the company is growing or shrinking. In 2025 more people left than joined, in 2026 it was the other way round.
Common mistakes
Comparing only the year
YEAR(Employee[HireDate]) = 2026 only works while the matrix shows years. By month every month would be the same. MIN and MAX adapt to any period.
Boundary without the equals sign
With > instead of >= everyone who joined on the first day of the period is missing. Start dates on the first of the month are the rule.
In real Power BI
- Alternatively you connect Employee[HireDate] and Employee[LeaveDate] to the date table as inactive relationships and turn them on with USERELATIONSHIP. That is faster with many thousands of people, but makes the model harder to read.
- Internal transfers (new department) are neither hires nor leavers. For those you need a table with the history per person.
Check your result
- Task 1: There were 6 new hires in 2026, 4 of them in Production.
- Task 2: 2025 shows 2 new hires and 6 leavers, 2026 shows 6 new hires and 3 leavers.
Back to case 1 or the course overview.