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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
In my data,i have hiredate and termination date columns,based on that i need to arrive the total employee count for each year
Solved! Go to Solution.
Hi @Target ,
Thank you for @bhanu_gautam answer , and I have other suggestions for you:
Below is my Date table(indicate this customer activity time):
Below is my hiredate and termination date table:
You can create a new column to judge the customer whether work in company:
IsActive =
VAR CurrentDate = 'Date'[Date]
RETURN
CALCULATE(
COUNTROWS('Table'),
FILTER(
'Table',
'Table'[hiredate] <= CurrentDate &&
(ISBLANK('Table'[termination date]) || 'Table'[termination date] >= CurrentDate)
)
)
And then you can create a measure to calculate the number of the customer:
ActiveEmployees =
CALCULATE(
COUNTROWS('Table'),
FILTER(
'Table',
'Table'[hiredate] <= MAX('Date'[Date]) &&
(ISBLANK('Table'[termination date]) || 'Table'[termination date] >= MIN('Date'[Date]))
)
)
The final output will be like this:
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Target ,
Thank you for @bhanu_gautam answer , and I have other suggestions for you:
Below is my Date table(indicate this customer activity time):
Below is my hiredate and termination date table:
You can create a new column to judge the customer whether work in company:
IsActive =
VAR CurrentDate = 'Date'[Date]
RETURN
CALCULATE(
COUNTROWS('Table'),
FILTER(
'Table',
'Table'[hiredate] <= CurrentDate &&
(ISBLANK('Table'[termination date]) || 'Table'[termination date] >= CurrentDate)
)
)
And then you can create a measure to calculate the number of the customer:
ActiveEmployees =
CALCULATE(
COUNTROWS('Table'),
FILTER(
'Table',
'Table'[hiredate] <= MAX('Date'[Date]) &&
(ISBLANK('Table'[termination date]) || 'Table'[termination date] >= MIN('Date'[Date]))
)
)
The final output will be like this:
Best Regards,
Xianda Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,
IsActive =
VAR CurrentDate = 'DateTable'[Date]
Here DateTable[Date] is derived from calendarAuto fuction?
Yes, it is a date table
Proud to be a Super User! |
|
@Target ,Add calculated columns to determine if an employee was active in a given year. You can do this by creating a column in your date table that checks if the date falls between the hire date and termination date.
IsActive =
VAR CurrentDate = 'DateTable'[Date]
RETURN
CALCULATE(
COUNTROWS('YourTable'),
FILTER(
'YourTable',
'YourTable'[hiredate] <= CurrentDate &&
(ISBLANK('YourTable'[terminationdate]) || 'YourTable'[terminationdate] >= CurrentDate)
)
)
Than create a measure for active employee
Proud to be a Super User! |
|
It shows error
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 103 | |
| 80 | |
| 63 | |
| 50 | |
| 45 |