Forum Discussion
Anonymous
1 year agoNot applicable
Employee turnover
Hello, I am tasked with making a calculation of what percentage of people has left the company group for each period using the PowerBI. The link to the mock data is as follows: https://docs.google...
Poojara_D12
Super User
1 year agoHi Anonymous
I have tried to give you the DAX:
Total_Employees_Start =
CALCULATE(
COUNTROWS(EmployeeTable),
FILTER(EmployeeTable, EmployeeTable[StartDate] <= MIN(DateTable[Date]))
)Total_Employees_End =
CALCULATE(
COUNTROWS(EmployeeTable),
FILTER(EmployeeTable, EmployeeTable[StartDate] <= MAX(DateTable[Date]))
)Employees_Leaving =
CALCULATE(
COUNTROWS(LeaveEventTable),
FILTER(LeaveEventTable, LeaveEventTable[LeaveDate] >= MIN(DateTable[Date]) && LeaveEventTable[LeaveDate] <= MAX(DateTable[Date]))
)Turnover_Percentage =
DIVIDE(
[Employees_Leaving],
DIVIDE([Total_Employees_Start] + [Total_Employees_End], 2)
) * 100
- Create a unique Employee table for tracking individuals.
- Use measures for counting employees at the beginning and end of the period.
- Track the number of employees leaving during the period.
- Use these values to calculate the turnover percentage and filter by company and year.
Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂
Kind Regards,
Poojara
Data Analyst | MSBI Developer | Power BI Consultant
Consider Subscribing my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS
Anonymous
1 year agoNot applicable
Hi Poojara_D12 ,
Thank you for the prompt response.
Could you please elaborate what do you mean by LeaveEvent table?
Additionally, the formula countrows counts duplicates which i have (as shown on the mock data). I assume you mean distinctcount() instead?
Regards,