Which headcount you mean
Period-end, anyone employed during the period, or an average across it. Each is correct for a different question, and mixing them on one page is how two reports disagree.
Power BI How-To / HR Measures
Power BI headcount over time means counting the employees who were active on each date of your axis, using nothing more than a hire date and a termination date per person. This guide covers the measure logic only, and it works the same whatever HR system the data came from: period-end, any-day and average headcount, the turnover denominator, and the totals, termination-date and rehire mistakes that make trends wrong. Getting the data out of a specific system is a separate job, covered on our Workday Power BI dashboard page and its sibling connector pages.
The short version
Period-end, anyone employed during the period, or an average across it. Each is correct for a different question, and mixing them on one page is how two reports disagree.
The measure compares dates itself. An active relationship from the calendar to hire date quietly turns headcount into a count of new hires.
Last day worked or first day gone? The answer decides whether one comparison is >= or >, and getting it wrong shifts every leaver by one period.
A date-range measure is small and always current; a month-end snapshot table freezes department and location as they were. Pick by the history you need to report.
A headcount trend counts, for each period on the axis, the employees whose employment overlapped that period. The overlap rule decides the number: active on the last day of the period, active on any day of it, or active on average across it. All three come from the same hire and termination dates; they answer different questions.
| Definition | Employee is counted when | Best for | Watch out for |
|---|---|---|---|
| Period-end headcount | Hired on or before the period end, and not yet terminated at the period end | Month-end trend lines, org size by department, board packs | A hiring wave or layoff near the cutoff moves it sharply |
| Employed during the period | Hired on or before the period end, and terminated on or after the period start (or not terminated) | Anyone who needed a payslip, a laptop or a review in that period | Always at least as high as period-end; a full year can far exceed any single month |
| Average headcount | The mean of the period-end counts inside the selected range | Turnover-rate denominators, cost per employee | The averaging grain (daily, monthly, opening plus closing) must be stated |
Most HR questions want period-end headcount on the trend line and average headcount underneath any rate. ‘Employed during’ is useful for capacity and cost questions, but it is the number that most often gets mislabelled as headcount, because it is the easiest to build with a single filter.
You need one employee table with an employee ID, a hire date and a termination date that stays blank for current staff, plus a continuous Date table. Department, location and job attributes can sit on the same table. The Date table must not filter the employee table through an active relationship on hire date.
That last rule surprises people who follow the usual star schema guidance from Microsoft (opens in new tab), where the calendar filters the fact. Here the employee table is not a fact keyed to one date: each row spans a range. If the calendar filters Employees[HireDate], selecting March leaves only people hired in March, and the measure counts new hires. Leave the Date table disconnected from employees for the headcount measures. If you also want a terminations count by month, add an inactive relationship from 'Date'[Date] to Employees[TermDate] and switch it on inside that one measure. Our guide to time intelligence DAX and Date tables covers building and marking the calendar itself.
If people can leave and come back, store one row per employment spell (employee ID plus hire date) rather than one row per person, and count distinct employee IDs. A single row holding only the latest hire date erases the first spell from history.
Take the last date visible in the current filter as the period end, then count employees hired on or before it whose termination date is blank or falls on or after it. Wrapped in CALCULATE, that one measure gives month-end, quarter-end and year-end headcount from the same formula, because the period end moves with the axis.
| Measure | DAX | What it returns |
|---|---|---|
| Headcount | VAR PeriodEnd = MIN( MAX( 'Date'[Date] ), TODAY() ) RETURN CALCULATE( DISTINCTCOUNT( Employees[EmployeeID] ), Employees[HireDate] <= PeriodEnd, Employees[TermDate] >= PeriodEnd || ISBLANK( Employees[TermDate] ) ) |
Employees active on the last day of the period (or today, for the current period) |
| Employed During Period | VAR PeriodStart = MIN( 'Date'[Date] ) VAR PeriodEnd = MAX( 'Date'[Date] ) RETURN CALCULATE( DISTINCTCOUNT( Employees[EmployeeID] ), Employees[HireDate] <= PeriodEnd, Employees[TermDate] >= PeriodStart || ISBLANK( Employees[TermDate] ) ) |
Anyone employed on at least one day of the period |
| Average Headcount | AVERAGEX( VALUES( 'Date'[Year Month] ), [Headcount] ) |
The mean of the month-end headcounts inside the selection |
| Terminations | CALCULATE( DISTINCTCOUNT( Employees[EmployeeID] ), USERELATIONSHIP( 'Date'[Date], Employees[TermDate] ) ) |
Leavers whose termination date falls in the period |
Both filter arguments in Headcount are Boolean filters on a single column, which CALCULATE accepts and applies together. The ISBLANK test matters: current employees have no termination date, and without it they drop out of every period. TODAY() caps the period end so the current month shows today’s staff rather than people whose termination is already booked for later in the month. Microsoft’s CALCULATE function reference (opens in new tab) documents the Boolean filter rules these measures rely on.
Change one comparison. An employee overlaps a period when they were hired on or before its last day and their termination is blank or on or after its first day. That overlap test, which Excelerator BI walks through in its how-many-employees-by-period article, is the Employed During Period measure in the table above.
The two boundaries are what make it work: the hire test uses the period end and the termination test uses the period start. Swap them and you count only people who were present for the whole period. Excelerator BI’s write-up of the overlap logic (opens in new tab) builds the same condition with explicit first-date and last-date variables. Use this number for questions like ‘how many people did we pay in Q3’, not for the headline trend.
Use average headcount as the denominator. A period-end count reflects a single day and swings with any hiring wave or layoff near the cutoff, while ‘employed during’ inflates the base with the leavers themselves. Divide Terminations by Average Headcount, and state the averaging method on the report so the rate can be reproduced.
The measure is Turnover Rate = DIVIDE( [Terminations], [Average Headcount] ). Over a single month the average is just that month’s end count; over a year it is the mean of twelve month-end counts. Some HR teams define average headcount as opening plus closing headcount divided by two; that is a policy decision, not a DAX one, and the formula changes to DIVIDE( [Opening Headcount] + [Headcount], 2 ) with Opening Headcount evaluated at the day before the period starts. This page gives no turnover benchmarks: compare your own periods with each other, on one definition, rather than against a published figure built on a different one.
Below is an illustrative five-person team over one quarter, on sample data. It shows how the three definitions diverge, how a termination on the last day of a month changes the count depending on the comparison operator, and why the quarter total must not be a sum of the months.
The sample team: A and E were employed before the quarter and E’s recorded termination date is the last day of Month 3; B was employed before the quarter and terminated on day 14 of Month 2; C was hired on day 10 of Month 1; D was hired on day 3 of Month 3. A, C and D are still employed.
| Period | Period-end, TermDate >= end | Period-end, TermDate > end | Employed during period |
|---|---|---|---|
| Month 1 | 4 (A, B, C, E) | 4 | 4 (A, B, C, E) |
| Month 2 | 3 (A, C, E) | 3 | 4 (B still counts) |
| Month 3 | 4 (A, C, D, E) | 3 (E excluded) | 4 (A, C, D, E) |
| Quarter, correct measure | 4 | 3 | 5 |
| Quarter, months summed (wrong) | 11 | 10 | 12 |
| Average headcount | 3.67 | 3.33 | Not used |
Read the Month 3 row first. If your HR system records the termination date as the last day worked, E was still employed at the close of Month 3, so >= is right and the count is 4. If it records the first day the person is gone, > is right and the count is 3. Neither operator is universally correct; check what your export means before trusting either column. Then note that the correct quarter figure equals the Month 3 value for period-end headcount, but 5 for ‘employed during’, because everyone who worked any day of the quarter counts once.
Most broken headcount reports trace to six causes: totals that sum months, an active Date relationship on hire date, a termination-date convention applied the wrong way, blank or placeholder termination dates, rehires stored as one row, and current-only department attributes restating history. Check those before rewriting the measure.
>= or > to match.ISBLANK behaves.A seventh failure is performance. Expanding every employee into one row per day of employment in Power Query looks like the simple fix, but the table grows with every employee and every day of tenure, and it is behind the out-of-memory refresh errors people report on community forums. The measures above need no expansion at all.
Start with the date-range measure: one table, no expansion, and it answers any period on any axis. Move to a month-end snapshot table when you must report headcount by the department, manager or location people had at the time, because a measure over current attributes restates history whenever someone transfers.
| Consideration | Date-range measure | Month-end snapshot table |
|---|---|---|
| Model size | One row per employment spell | One row per employee per month-end; grows every month |
| Historical department or location | Current values only, unless joined to effective-dated job history | Frozen as they were at each month-end |
| Granularity | Any date, week, month or fiscal period | Month-end only, unless you snapshot more often |
| Correcting a backdated termination | Fixed automatically on the next refresh | Past snapshots keep the old answer unless rebuilt |
| Totals | Correct by construction (evaluated at the period end) | Need a last-snapshot measure; a plain count sums months |
For the snapshot design, the semi-additive measure is CALCULATE( COUNTROWS( Snapshot ), LASTNONBLANK( 'Date'[Date], CALCULATE( COUNTROWS( Snapshot ) ) ) ), with the Date table related to the snapshot’s month-end date. LASTNONBLANK picks the latest month-end that has rows, so a year total returns the last loaded month even when the calendar runs to December. The same ‘evaluate at a point, not over a range’ idea sits behind cumulative measures; our running total DAX guide covers the contrasting pattern that does accumulate across dates.
Any HR or payroll system that can export employee ID, hire date and termination date will feed these measures. The extraction route is what differs: report-as-a-service feeds, REST APIs or scheduled custom reports, each with its own authentication and refresh limits. Those system-specific details live on separate connector pages rather than here.
For Workday, effective-dated worker records and the supervisory organization hierarchy are covered on the Workday Power BI dashboard page. ADP Workforce Now extraction is on the ADP Power BI dashboard page, the Paylocity API route is on the Paylocity Power BI dashboard page, and UKG Pro report extracts are on the UKG Pro Power BI dashboard page. Whichever source you use, check two things in the first export: whether termination dates mean last day worked, and whether rehires arrive as new rows or overwrite the old one.
Bring in help when headcount feeds a board pack or a turnover target and the source data is untidy: rehires, transfers that must be reported historically, several HR systems after an acquisition, or a refresh that already runs out of memory. The measures here are short; agreeing definitions and cleaning spells is where the hours go.
Power BI Flex Support is prepaid, senior-led Power BI hours that never expire, with no contracts and no project minimums. Blocks are Starter $2,500, Growth $4,600 and Power $8,000, and hourly work starts from $100. You send the request, we reply with a scope and an hours estimate before any work, hours are deducted only for work you approve, and most tasks land 3–5 business days after approval. If headcount is one symptom of a tangled model, the same hours cover data modeling and DAX work. Contact is through the form on this site.
FAQ
The usual convention is to divide terminations by average headcount, because a period-end count reflects a single day and swings with any hiring wave or layoff near the cutoff. Average the month-end counts across the period, or average opening and closing headcount if that is your documented policy. Label the choice on the report.
Headcount is semi-additive: it adds across departments but not across time. If a monthly snapshot table is summed, a full year returns roughly twelve times the real figure. Return the last available snapshot instead, or use a measure that evaluates at the latest date in the current filter, so the year total equals the year-end count.
Not with an active relationship on hire date. An active link filters employees to people hired inside the selected month, so the measure counts new hires instead of everyone employed. Leave the Date table disconnected from the employee table, or keep the relationships inactive, and let the measure compare hire and termination dates to the period boundaries itself.
Store one row per employment spell, keyed by employee ID and hire date, rather than one row per person. A spell table keeps the gap between leaving and returning. Then count with DISTINCTCOUNT on the employee ID instead of COUNTROWS, so someone who left and came back inside the same month is counted once.
Yes. A senior, US-based, Microsoft-certified engineer can build the headcount measures, date table and report on your own HR export from prepaid Flex hours that never expire. Blocks are Starter $2,500, Growth $4,600 and Power $8,000, with hourly work from $100. We quote the hours before starting, and most tasks land in 3 to 5 business days after approval.
If you’re unhappy within the first 4 hours of your block, we’ll refund you in full — no questions asked. Hours are deducted only for work you’ve reviewed and approved, and they never expire.
Bring your HR export to a free demo. We confirm what your termination dates mean, agree the headcount definition with you, and build the measures on prepaid hours that never expire. Most tasks land in 3–5 business days.
Scope approved before any hours are used · Hours never expire
Tell us the task. We scope it, you approve, and a senior consultant delivers — typically in 3–5 business days. Prepaid hours that never expire.