cyrilbrd
Well-known Member
- Joined
- Feb 2, 2012
- Messages
- 4,113
- Office Version
- 365
- Platform
- Windows
- Mobile
Hi, presently using the following:
[Present] is the date of today
[Expenses] is the measure of interest.
This works well from february to December of year n, but starts failing on January of year n+1
Any idea on how to let it compute December if we are on January?
Code:
[COLOR=#000000][FONT=Consolas]PreviousReport = [/FONT][/COLOR][COLOR=#000000][FONT=Consolas]VAR
CurrentDate = [Present]
RETURN
CALCULATE([Expenses],
Raw_data[MONTH] = MONTH(CurrentDate)-2
[/FONT][/COLOR]
[COLOR=#000000][FONT=Consolas] )[/FONT][/COLOR]
[Expenses] is the measure of interest.
This works well from february to December of year n, but starts failing on January of year n+1
Any idea on how to let it compute December if we are on January?