Calculate Number of Months Between Two Dates in Power Query

doco

New member
Joined
Jul 30, 2019
Messages
2
Reaction score
0
Points
1
Location
e oregon
Excel Version(s)
2000, 2013, 365
Looking for DAX formula to make the subject calculation. What I have found in Google searches insists there is a DATEDIFF function in DAX for which THERE MOST CERTAINLY IS NOT!

I have attempted to use

((Date.Year(01/01/2023) - Date.Year([Date From Field])) * 12) + (Date.Month([Date From Field]) - Date.Month(01/01/2023))

But it doesn't like that at all. DAX is far too pedantic and verbose. Typical...

Any help would be appreciated.

TIA
doco
 
Do you mean PowerPivot or Power Query?
 
1. Are you looking for whole number results or would a result such as 2.1 months be sought?
2. How many months would you expect the result to be from 29 April 2022 to 2 May 2022? (It's only 3 or 4 days.)
 
I have since discovered I need M not DAX. So, have resolved the issue. Sorry for the late response.
 
Back
Top