Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
DynamicsHS
Helper II
Helper II

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.