Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Measure for End of month Label with inconsistent days before month close

Hi PowerBI-ers,

 

The company I work for closes month end ordering process on different days.  sometimes they will close the 1st day of the next month, sometimes the 2nd day.  But it the 1st day of the new month is a Saturday, they may not close until the 3rd or 4th of the month.  I have the following meaure for showing the monthl text for one of my card headings:

 

Label MTD Budget = FORMAT(TODAY()-3,"MMMM")  & " MTD Budget"

and this of course reads as 

 

August MTD Budget

 today because it's the 2nd of sept and - 3 days is still August.  This is ok this month but I will have to change this measure every month depending on the day the business rolls over.

 

For all my calculations is fine becuase I just change the page filter when the new month rolls over but I don't want to have to change my 2 measures that I have also, it's not really in the spirit of automation.  Neither is changing filters I know but that doesn't bother me.

 

Anyway, is there anyway that the text "MMM" (August) could also be switched when I change the page filter?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

actually, all good the card had a filter on it, all good no bug, I worked this out by myself but thanks anyway guys!

View solution in original post

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

@Anonymous - Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

All I want to do is change the month for a label when I update a filter.  But I actually worked it out.

 

first I have the measure:

 

Label Month Switch With Filter = MIN(Date_Master_T[Month Name])

 

That returns the first month from my date table, then I use this measure in the following:

 

Label MTD Budget = [Label Month Switch With Filter]  & " MTD Budget"

and the output is a card label that reads:

 

August MTD Budget

when the page filter is set to August.

 

works with all labels except one, it doesn't return any month at  all when I switch the filter to September, weird, any ideas on why?  the card label is exactly the same but different results.

Anonymous
Not applicable

actually, all good the card had a filter on it, all good no bug, I worked this out by myself but thanks anyway guys!

Hi  @Anonymous ,

 

Glad to hear that,could you pls mark the reply as answered to close it?

 

 
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
 
amitchandak
Super User
Super User

@Anonymous , for any date you can get last date like

 

format(eomonth([date],-1),"MMM")

 

So you can put logic and find eomonth with -1

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors