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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Dynamic Month Slicer

Hi,

I want to select  dynamically last 4 month .It should select last 4 months and unselect other months dynmically.Month is coming from calendar table.Any idea how to do this?

 

image.png

7 REPLIES 7
Ashish_Mathur
Super User
Super User

Hi,

See if my solution here helps - Flex a Pivot Table to show data for x months ended a certain user defined month.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

It is unsupported to set default values for a slicer. You may control the selectable values by slicers or filters. While you are unable to control selected value with them. I'd like to suggest you vote on the idea and add your comments there to improve Power BI for making this feature coming sooner.

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

amitchandak
Super User
Super User

@Anonymous , There no way unless you try a slicer like that and use that for selection

 

Month Type = Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY")
)

 

or

 

Month Type = Switch( True(),
eomonth([Date],0) >= eomonth(Today(),-3) && eomonth([Date],0) <= eomonth(Today(),0),"Last 4 Month" ,
Format([Date],"MMM-YYYY")
)

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
Anonymous
Not applicable

@Anonymous - Usre Relative Date Slicer, 

NikhilKumar_0-1602744140606.png

 

Appreciate your kudos!! Mark this post as solution if this helps.

Anonymous
Not applicable

I have used relative filter, but its only showing last 4 month .

image.png

I want  last 4 months should selected and other months show unselected.

 

image.png

Anonymous
Not applicable

@Anonymous - Have you considered using timeline slicer - https://appsource.microsoft.com/en-us/product/power-bi-visuals/WA104380786?src=office

 

Appreciate your kudos!! Mark this post as solution if this helps.

Anonymous
Not applicable

One doubt , when Novemeber month will come then timeline slicer automatically select last four months?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.