Forum Discussion
how to get working experiences based on given data
- 1 year ago
Hi Prabha123 ,
To calculate the working experience (tenure) of employees based on their joining date and resigned date, you can use DAX in Power BI or an Excel formula to determine the duration in years and months. The DATEDIFF function can be used to compute the difference between the Joining Date and Resigned Date, returning the tenure in different time units. Since DATEDIFF only calculates a single unit (years, months, or days), we need to extract the years separately and then compute the remaining months.
This ensures that the final output correctly reflects the employee's experience in a readable format like "X Years, Y Months". Below is the DAX formula to achieve this in Power BI.
WorkingExperience = VAR Years = DATEDIFF(EmployeeTable[Joining date], EmployeeTable[Resigned date], YEAR) VAR Months = DATEDIFF(EmployeeTable[Joining date], EmployeeTable[Resigned date], MONTH) - (Years * 12) RETURN Years & " Years, " & Months & " Months"his formula ensures that each employee’s tenure is accurately represented while handling variations in months and years effectively.
Prabha123 , One a new column using datediff
Exp = datediff([Joining Date], [Resigned date], year)
or if you need dynamic based on selected month follow this HR blog video of attached file
Power BI: HR Analytics - Employees as on Date : https://youtu.be/e6Y-l_JtCq4
https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970
Power BI HR Active Employee Tenure Bucketing, and Hired, Terminated, and Active employees: https://youtu.be/fvgcx8QLqZU