Forum Discussion
Anonymous
3 years agoNot applicable
Create Latest and previous month marker
Hi I'm trying to solve what i think should be a pretty simple problem, but it's beating me! I'm trying to create a calculated column which basically returns whether a date is the "latest" mon...
- 3 years ago
Anonymous
Try this code - I just tweaked your original code, but you need to add one more calculated column called PrevMonth. Check this out.
1.
Prev Month = PREVIOUSMONTH(Date_table[Month_end])2.
Month Marker = if(Date_table[Month_end] = MAX(Date_table[Month_end]), "Latest", if(Date_table[Month_end] = max(Date_table[Prev Month]), "Previous","NA"))Let me know if this works for you. Many Thanks
Anonymous
3 years agoNot applicable
So i'm trying to achieve this
| Month end | Month marker |
| 30/09/2022 | NA |
| 31/10/2022 | NA |
| 30/11/2022 | Previous |
| 31/12/2022 | Latest |
Manoj_Nair
Solution Supplier
3 years agoAnonymous
Try this code - I just tweaked your original code, but you need to add one more calculated column called PrevMonth. Check this out.
1.
Prev Month = PREVIOUSMONTH(Date_table[Month_end])
2.
Month Marker = if(Date_table[Month_end] = MAX(Date_table[Month_end]), "Latest", if(Date_table[Month_end] = max(Date_table[Prev Month]), "Previous","NA"))
Let me know if this works for you. Many Thanks