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.
Hi, Prabha123
Have you solved your problem? If so, can you share your solution here and mark the correct answer as a standard answer to help other members find it faster? Thank you very much for your kind cooperation!
Best Regards
Yongkang Hua