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

Need a way for date in between slicer to dynamically change to and from dates

Hi folks,

I am working on a huge dashboard and have many slicers on the report page. I have 2 slicers on top that are as below:
1. Week ending with date

revolutionpbi_1-1689788002751.png

 


2. Weeks before the week ending date

revolutionpbi_0-1689787951628.png


I need another slicer below for one of my bar chart visuals which will show only dates that will be within the date range selected above. I have the slicer as below but the dates is all dates from the date table:

revolutionpbi_2-1689788183029.png

I use the below measure to filter the slicer 

 

 

dateBetween = 
VAR selected = SELECTEDVALUE('Calendar'[Date])
VAR C = CALCULATE(SWITCH(SELECTEDVALUE('Period Length'[Periodlength]), "4 weeks",  28 , "52 weeks", 364, "1 week", 7, "104 weeks",728 , "24 weeks", 168, "26 weeks", 182, "12 weeks", 84)) 
VAR minDate = selected - C
RETURN 
    IF (
        SELECTEDVALUE ( 'Static Calendar'[Date] ) <= selected
            && SELECTEDVALUE ( 'Static Calendar'[Date]) >= minDate,
        1,
        0
    )

 

 

This works on a vertical list of values in slicer but doesn't work on Between dates slicer screenshot below:

revolutionpbi_3-1689788512375.png

Is there a way it will show the start date and end date in the slicer in between date format?

Thanks for you help!



1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @Anonymous 
This happens because to have a slicer as range you need to have all days between the range.

Only single-level consecutive numbers/dates are supported.
It does not work on "torn" sequences

Therefore, it will work on 1,2,3,4,5
However, it will not work on 1,3,5
The same thing for dates.

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

1 REPLY 1
Ritaf1983
Super User
Super User

Hi @Anonymous 
This happens because to have a slicer as range you need to have all days between the range.

Only single-level consecutive numbers/dates are supported.
It does not work on "torn" sequences

Therefore, it will work on 1,2,3,4,5
However, it will not work on 1,3,5
The same thing for dates.

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

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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.