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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Super User
Super User

@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.


@ 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!:
The Definitive Guide to Power Query (M)

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.