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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
nsaray
Helper II
Helper II

Filter on Latest Month and display Month and Year

Hi

I have 3  visuals on a page, 2 has trend informaton  so the date filters range over a few months. The last visual I only want to display data from the latest month of the available dataset.

1. How can I filter the one visual to only show the latest month's worth of data. ie. If it's currently Oct 2021, but in my dataset the last month of data  I have is May 2021, I want it to display May 2021 data.

2. How do I then also display it as Mon YYYY on a card visual (ie. May 2021)

 

Thanks!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@nsaray , You need use the first column in date table and select last month in slicer

 


Month Type = Switch( True(),
eomonth([Date],0)= eomonth(maxx((Table), Table[Date]),0), "Last Month" ,
Format([Date],"MMM-YYYY")
)

 

You can use this measure to displat last month

last month = format(maxx(allselected(Table), Table[Date]), "MMMM-YYYY")

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@nsaray , You need use the first column in date table and select last month in slicer

 


Month Type = Switch( True(),
eomonth([Date],0)= eomonth(maxx((Table), Table[Date]),0), "Last Month" ,
Format([Date],"MMM-YYYY")
)

 

You can use this measure to displat last month

last month = format(maxx(allselected(Table), Table[Date]), "MMMM-YYYY")

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Perfect, thank you!!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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