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! Request now

Reply
Sambath
Frequent Visitor

Slicer with last 12 complete months and dynamic default to the latest complete month

Hello Power BI Gurus,

 

I'm looking for a simple solution to have a 12 month slicer that dynamically defaults to the latest complete month. For example, while we are in Apr 2023, I wanted to have a slicer with the last 12 complete months: Mar 2023, Feb 2023, ..., Apr 2022 and it defaults to the latest complete month - Mar 2023 in this example. I've come across a few posts that suggest how to make the latest month/current month/today as default but can't figure out how to have a list of months on top of it. 

Note: I have a calendar table in my report. 

See a screenshot of a similar slicer that I built in another BI platform. 

Sambath_0-1681366122737.png

 

Thank heaps in advance for any suggestsions. 

Regards 

 

3 REPLIES 3
danextian
Super User
Super User

Hi @Sambath ,

 

Your second  requirement is currently not supported. I've read somewhere in the internet that this may be a thing soon but I can't find that in the current Power BI roadmap. Alternatively, you can add a calculated column that indicates whether period is the latest one.

 

For your first requirement, you have to create a calculted column to filter the available periods to show only the last 12 ones.  Here's a sample formula

Number of Months from Current = 
VAR __months =
    DATEDIFF ( Dates[Date], MAX ( Dates[Date] ), MONTH ) + 1
RETURN
    __months <= 12

 

Please  see attached pbix for your reference.

 

 





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
ovde
Resolver II
Resolver II

Hi Sambath,

You probably want to apply a relative date filter to your slicer using the date field from your calendar. This wil show al list of the last twelve completed months. Is far as I'm aware you cannot set a dynamic default, but with sort you can set the latest month to show up on top.

ovde_0-1681366988280.png

 

Hope this helps!

Sambath
Frequent Visitor

Thank for the prompt response but I wanted these two features: default to the latest complete month and a list of the last 12 months for users to select. 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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
Top Kudoed Authors