cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
DynamicsHS
Helper I
Helper I

How to get the Years & months between two date?

Hi, 

 

I want to be able to calculate length of service based on active workers. I used DATEDIFF([Hire Date],[today],YEAR).

 

This gave me the whole numbers of the year ....but i want it to be able to break down so that if an employee has been with the company for 2 and a half years it will show up as 2.6 rather than just 2 years at the moment. 

 

is this possible?

 

Thanks,

HS

 

 

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@DynamicsHS 

what about try thsi

DATEDIFF([Hire Date],[today],MONTH) / 12 .





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

4 REPLIES 4
jdbuchanan71
Super User
Super User

@DynamicsHS 

You would be very close with 

 

DIVIDE ( DATEDIFF([Hire Date],[today],DAY), 365)

If you want to keep it to 1 decimal do 

ROUND(DIVIDE ( DATEDIFF([Hire Date],[today],DAY), 365),1)

 

ryan_mayu
Super User
Super User

@DynamicsHS 

what about try thsi

DATEDIFF([Hire Date],[today],MONTH) / 12 .





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




It worked! Thank you

you are welcome





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors
Top Kudoed Authors