Since you posted in PQ/PP forum. I'm assuming that you want this in DAX.
General construct. Assuming that you have calendar table.
This assumes that active employee is those employee active at end of year. And Pivot has year as row field.
Code:
NumEmp :=
VAR curDate =
MAX ( DimDate[Date] )
RETURN
CALCULATE (
DISTINCTCOUNT ( empdata[emp_id] ),
empdata[date_of_hire] <= curDate,
OR ( ISBLANK ( empdata[date_of_term] ), empdata[date_of_term] > curDate )
)
Exact calculation will depend on what you consider to be active employee in a given year.