I have 2 tables
1 table is date table with following fields: date, month, quarter, year, yearmonth,yearnumber
2nd table is Employee table with following fields: EmpID, Hired Date, Termination Date, employees that are active have a blank termination date.
I am trying to do employee head count by month and year. Wrote a dax measure using forums but it is showing me blank results:
Would be gratefull for any help here.
HeadCount =
var endperiod=MAX('date'[Date])
var startperiod=MIN('date'[Date])
return
CALCULATE(DISTINCTCOUNT('shared User'[EmployeeId]),FILTER(ALL('shared User'),('shared User'[HireDate]<=endperiod && 'shared User'[TerminationDate]>=startperiod)))