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

How to display last month along with year ?

I wanted to display the last month with year in a card visual.

Suppose now it's Dec 2022, then it should display Nov 2022. If it's Jan 2023, it should display Dec 2022.

The format should be either "MMM YYYY" or full month name year. 

1 ACCEPTED SOLUTION
Mikelytics
Resident Rockstar
Resident Rockstar

 

Hi @Anonymous 

 

Last Month = FORMAT(EOMONTH(TODAY(),-1), "MMMM /YYYY")

Mikelytics_0-1671456230768.png

 

If you work with a data table and you want to filter you can also do something like:

 

Last Month = FORMAT(MAX(DimDate[Date]),-1), "MMMM /YYYY")

 

Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Appreciate your thumbs up!
@ me in replies or I'll lose your thread.

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!

View solution in original post

4 REPLIES 4
FreemanZ
Super User
Super User

hi @Anonymous 

try to plot with a column like this:

MMMYYYY = FORMAT(EDATE(TODAY(), -1), "MMM YYYYY")

Mikelytics
Resident Rockstar
Resident Rockstar

 

Hi @Anonymous 

 

Last Month = FORMAT(EOMONTH(TODAY(),-1), "MMMM /YYYY")

Mikelytics_0-1671456230768.png

 

If you work with a data table and you want to filter you can also do something like:

 

Last Month = FORMAT(MAX(DimDate[Date]),-1), "MMMM /YYYY")

 

Best regards
Michael
-----------------------------------------------------
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Appreciate your thumbs up!
@ me in replies or I'll lose your thread.

------------------------------------------------------------------
Visit my blog datenhungrig which I recently started with content about business intelligence and Power BI in German and English or follow me on LinkedIn!
Uspace87
Resolver III
Resolver III

@Anonymous 

 

 

Last Month = FORMAT(TODAY() - 1, "MMMM /YYYY")

@Anonymous 

 

sorry, try this:

 

Last Month =
FORMAT(
    EOMONTH(TODAY(), -1),
    "MMMM /YYYY"
)

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.