Forum Discussion
Last day current month
I'm trying to write a measure that will let me know the last day of the current month:
Hi Anonymous
That makes a lot of sense. Try this measure and hopefully it will give you the end of the current month:
Measure = EOMONTH ( TODAY () , 0 )
(updated thanks to parry2k to ensure no one uses the ridiculousness of my earlier "solution").This will give 28 Feb 2022. You can adjust month by changing the 0 at the end accordingly.Hope this helps 🙂Theo
8 Replies
- parry2k
Super User
Anonymous in future you should be very clear in your requirement so that it saves everyone's time. Just my 2 cents. Well done TheoC but you don't have to do all that, you can just simply do this FYI
Measure = EOMONTH ( TODAY () , 0 )✨ Follow us on LinkedIn and to our YouTube channel
Check my latest video on Filters and Sparklines https://youtu.be/wmwcX8HvNxc
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.
- parry2k
Super User
Anonymous if you are writing a measure this is what you should use:
Last Day of month = EOMONTH ( MAX ( YourTable[Date] ), 0 )✨ Follow us on LinkedIn and to our YouTube channel
Check my latest video on Filters and Sparklines https://youtu.be/wmwcX8HvNxc
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡ Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.
- TheoC
Community Champion
Hi Anonymous
If the measure that parry2k results in the same output, there may be a manual input error in the source file (i.e. Excel or CSV file) that you are using which has led to someone typing the year as 2072 rather than 2022 or the like. However, if it's not this, then I am sure parry2k measure will provide you with the solution you are after.
All the best either way!
Theo
- AnonymousNot applicable
- TheoC
Community Champion
Hi Anonymous
That makes a lot of sense. Try this measure and hopefully it will give you the end of the current month:
Measure = EOMONTH ( TODAY () , 0 )
(updated thanks to parry2k to ensure no one uses the ridiculousness of my earlier "solution").This will give 28 Feb 2022. You can adjust month by changing the 0 at the end accordingly.Hope this helps 🙂Theo
- parry2k
Super User
Anonymous what is the last date in your table? How you are viewing the data? Read this post to get your answer quickly.
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490 - TheoC
Community Champion
Hi @kari1282
That makes a lot of sense. Try this measure and hopefully it will give you the end of the current month:
Measure = EOMONTH ( TODAY() , 0 )
This will give 28 Feb 2022 (at time of writing this response). You can adjust month by changing the 0 at the end accordingly.Hope this helps 🙂Theo