Forum Discussion
Anonymous
7 years agoNot applicable
Using the M-code Date.IsInPreviousNMonths, having some issues
Hi all, I'm using this formula in Power Query (M): if Date.IsInPreviousNMonths([LASTMODIFIEDDATE], 3)=true then "Yes" else "No". But why do I get No on dates between 01.04.2019 and today ? A...
- Anonymous7 years ago
Your April 1st 2019 dates are in the current month, so it cant be in the previous N months as well.
Date.IsInCurrentMonth([LASTMODIFIEDDATE])
Anonymous
7 years agoNot applicable
thanks :)
How do I accept your answer as soulotion?
This works:
if Date.IsInCurrentMonth([LASTMODIFIEDDATE])=true then "Yes" else if Date.IsInPreviousNMonths([LASTMODIFIEDDATE], 3)=true then "Yes" else "No"
Anonymous
7 years agoNot applicable
Glad it helped !