Forum

duration in year an...
 
Notifications
Clear all

duration in year and month

2 Posts
2 Users
0 Reactions
388 Views
(@ayemu7)
Posts: 197
Reputable Member
Topic starter
 

Hi team,LengthOfStay.PNG

I have 2 dates in power query and I would like to get duration in Year and month.

please let me know for the formula.

thank you.

Regards,

Aye

 
Posted : 02/06/2020 7:58 am
(@catalinb)
Posts: 1937
Member Admin
 

Hi Aye,

Duration is provided only in a few units, not year or months: https://docs.microsoft.com/en-us/powerquery-m/duration-functions

You will have to convert days to years or months.

365/12 will give you the average number of days per month. To convert days-duration to years, use Duration/365, or Duration/365.25. Because of leap years, there will be a small calculation error.

 
Posted : 02/06/2020 11:15 am
Share: