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
Bokchoy
Helper II
Helper II

Pre set date slicer with button

Hi everyone

 

I have a line graph that is filtered by a date slicer. I want to have a button that will automatically set my date slicer to the last (x) days from today. I don't want to filter or restrict the date range available as I still want to change the date range beyond the last (x) days if required.

 

Currently, I can set my date range between 2 dates with a bookmark, but I can't find a way to set a relative date range from today.

 

is this possible?

 

Bokchoy_0-1617251369998.png

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Bokchoy , best is relative date slicer. if that can work

https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range

 

Second to default values like this:a new column in date table

Is Last 30 = if('Date'[Date]>=TODAY()-30 && 'Date'[Date]<=TODAY(),"Today",[Date]&"")

 

refer video: https://www.youtube.com/watch?v=hfn05preQYA

 

You can also log a new idea or vote for an existing:  one https://ideas.powerbi.com/ideas/

 

 

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

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Bokchoy , best is relative date slicer. if that can work

https://docs.microsoft.com/en-us/power-bi/visuals/desktop-slicer-filter-date-range

 

Second to default values like this:a new column in date table

Is Last 30 = if('Date'[Date]>=TODAY()-30 && 'Date'[Date]<=TODAY(),"Today",[Date]&"")

 

refer video: https://www.youtube.com/watch?v=hfn05preQYA

 

You can also log a new idea or vote for an existing:  one https://ideas.powerbi.com/ideas/

 

 

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

Thank you for the solution.

 

I also found another quick solution. The relative date-time option for my date slicer was hidden due to the slicer header being "off" 

Bokchoy_0-1617252670716.png

I switched it back on and it gave me the option to select the relative time.

Bokchoy_2-1617252780684.png

 

Bokchoy_1-1617252749911.png

 

 




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