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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
pritzlb
Regular Visitor

Setting Relative Start and End Dates with Between type Date Slicer

So I have a "Between" style date slicer which is working nearly exactly as the users want.  The problem is that they want the start and end values of the slicer to be set dynamically -- the ending date set to yesterday and the starting date to 30 days prior.  So when users open the report it is showing the prior 30 days of data and they can change form there.  I have searched in vain for a way to do this.  I can put filters on the report or page but they do not change the start and end date values in the slicer.  I am manually changing dates and republishing each day.  Ridiculous.

 

I know I can put in a relative date slicer -- but they users want calendar controls to select a start and end date for the ultimate in flexibility.

1 ACCEPTED SOLUTION

Thanks.  This works -- only as long as you do not accidentally select a date from the dropdown calendar (as I might do to test) and then save the report.  Once you select a date from the calendar drpdown in the slicer it ignores the formula and caches the value you selected.  The only solution I have found is to recreate the slicer from scratch and not pick a date.  This is a caveated solution.  Thanks.  

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @pritzlb,

 

Based on my test, I made an sample for your reference.

 

You can create a filter column using the formula.

 

filter = IF(cal[date]<=TODAY()-1 &&cal[date]>=TODAY()-30,cal[date],BLANK())

Then you can get the result as you need.

 

Capture.PNG

For more details, please check the pbix as attached.

 

https://www.dropbox.com/s/g3w9sq2nipf723r/Setting%20Relative%20Start%20and%20End%20Dates%20with%20Be...

 

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Thanks.  This works -- only as long as you do not accidentally select a date from the dropdown calendar (as I might do to test) and then save the report.  Once you select a date from the calendar drpdown in the slicer it ignores the formula and caches the value you selected.  The only solution I have found is to recreate the slicer from scratch and not pick a date.  This is a caveated solution.  Thanks.  

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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