Forum Discussion
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 , 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/
2 Replies
- amitchandakSuper 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/
- BokchoyHelper II
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"
I switched it back on and it gave me the option to select the relative time.