Forum Discussion
Show Last Month Name
Hello,
I have a calendar table fully filled in with a date and month name, example below.
| Full Month Name | Full Date |
| September | 09/01/2023 |
I need to show last month name, I dug up the following measure from this forum:
CALCULATE(MAX('DIM Calendar'[Full Month Name]), DATESMTD(DATEADD('DIM Calendar'[Full Date],+1,MONTH)))
The measure works BUT is this the right way to write this out? +1 MONTH makes me think I am doing it wrong, if I replace it with - 1 MONTH, the result is August, not September.
Hi, Unknowncharacte
You can try the following methods.
Column:
Column = EOMONTH([Full Date],-1)Column 2 = FORMAT([Column],"mmmm")Measure:
Measure = FORMAT( EOMONTH(SELECTEDVALUE('Table'[Full Date]),-1),"mmmm")EOMONTH function (DAX) - DAX | Microsoft Learn
FORMAT function (DAX) - DAX | Microsoft Learn
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
5 Replies
- parry2k
Super User
Unknowncharacte it depends, on how your calendar table looks like. What is the last date in the table?
- Unknowncharacte
Helper III
Last date is 08/30/2028
- parry2k
Super User
Unknowncharacte what is the end goal? It is not clear. Because everything works in the context of how you are visualizing the data and what you are trying to achieve.
- v-zhangti
Community Support
Hi, Unknowncharacte
You can try the following methods.
Column:
Column = EOMONTH([Full Date],-1)Column 2 = FORMAT([Column],"mmmm")Measure:
Measure = FORMAT( EOMONTH(SELECTEDVALUE('Table'[Full Date]),-1),"mmmm")EOMONTH function (DAX) - DAX | Microsoft Learn
FORMAT function (DAX) - DAX | Microsoft Learn
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- Unknowncharacte
Helper III
Thank you so much!!!!!