Forum Discussion
texasbiuser
7 years agoFrequent Visitor
Display Current/Previous/Previous-Previous Month Name
Simple question today. I am formatting a report and have the need to display the Current month name, previous month name, and month prior to that. (Ie. January, February, March). This is to compare t...
- 7 years ago
Hi texasbiuser ,
Try this:
MonthName -3 = FORMAT ( DATE ( 2016, Table1[MonthNumber] - 3, 1 ), "MMMM" )
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
d_gosbell
Super User
7 years agoYou are doing the -3 on the name of the month (eg. "May") which does not make sense. You probably just need to do the -3 on the month number. Note: I'm also using the SELECTEDVALUE function to check that there is a single filter on the [Mth] column.
Mth -3 =
VAR _SelectedMth = SELECTEDVALUE('Table1'[Mth])
RETURN IF( ISBLANK(_SelectedMth), "n/a", FORMAT( date(2016,_SelectedMth-3,1), "MMM"))