Forum Discussion
trevb
10 years agoAdvocate II
Number of Months between two dates
This seems like a really dumb thing to be asking. I need to count the number of Months between two dates. I can happily find out the number of days, but that doesn't help much as number of days ...
drmbrklyn
9 years agoFrequent Visitor
I use this expression to evaluate a list of dates relative to today.
It returns 0 if the date is within the current month
-1 if the date is in the preceding month
+1 if the date is in next month.
Can easily be adapted for other uses (Day, Week, Quarter).
OrdMonth = if(today()<CAL[Date],datediff(today(),CAL[Date],MONTH),datediff(CAL[Date],today(),MONTH)*-1)