Notifications
Clear all
Power Query
2
Posts
2
Users
0
Reactions
388
Views
Topic starter
Hi team,
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
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