Hi forum friends,
I am working on an Employee Headcount calculation. There are two columns in employee table: hire date and termination date. I am not sure how to set up the relationship between employee table and Date table.
I’d like to calculate the number of leavers, number of hires, and number of current headcount.
I tried two ways: one is create two inactive relationship, and only make one relationship active to calculate the above 3 metrics. Another approach is not using USERELATINSHIP in the calculate function. Two ways got same results as showed below.
Can you kindly suggest why the results same when not specify which relationship is active?
Many thanks!!
Number of leavers:
-
Terminated Employees = CALCULATE(COUNT(Employee[Employee Id ]),USERELATIONSHIP(Employee[End Date],‘Date’[Date]),not(ISBLANK(Employee[End Date])))
-
Terminated Employees_test = CALCULATE(COUNT(Employee[Employee Id ]),not(ISBLANK(Employee[End Date])))
Hired Employees
- Hired Employee = CALCULATE(COUNT(Employee[Employee Id ]),USERELATIONSHIP(Employee[Start Date],‘Date’[Date]) )
- Hired Employee_test = CALCULATE(COUNT(Employee[Employee Id ]) )
Current_employee.pbix (80.8 KB)