Forum Discussion
jshutters
7 years agoResolver I
Calculate difference between two dates power query
How do I calculate the difference between two dates in Power Query M code (not DAX)? I'm looking for the number of days.
- 7 years ago
Hi jshutters
you need to use the duration functions: https://docs.microsoft.com/en-us/powerquery-m/duration-days
=each Duration.Days([Date1] - [Date2])
Anonymous
3 years agoNot applicable
Hello
How do I calculate the years between 2 dates on power query M coding?
Date formate is e.g. 2022-12-10
- jshutters3 years agoResolver I
J2008F, to calculate the years between 2 dates, you can use the Date.Year function in M coding. For example, Date.Year(<insert name of column2>) - Date.Year(<insert name of column1>)