Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

SWITCH with multiple between date filters

It should be simple, but somehow I cant figure it out. Trying to create a drop-down slicer that can select different week periods that overlap years, examples:

 

Week 40 - 20

Week 42 - 22

Week 45 - 25

 

So in the above example the returned data for "Week 40 - 20" should be between week 40 2020 and week 20 2021.

 

It cant be a calculated column, since the date can have multiple names. I'm using a basic date table that should have all thats required to reach my answer:

 

Its always last year + current year, so the measure should filter based on year+week. Perhaps a SWITCH formula isnt the way to go, but it initially made the most sense to me.

 

 

 

 

 

2 Replies

  • Anonymous , if you are able to create this week in your date table then you should be able to filter? Not able to get the issue

     

    Week text = "Week " & format(Weeknum([Date],2),"00") * format([Date], "YY")

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    amitchandak Im trying to create a dropdown slicer that has multiple options. Creating a calculated column would not work, because I want to be able to switch between multiple periods that overlap date. When I click on the slicer, I want the following (and more) options to choose from:

     

    Week 40 - 20 (so week 40 2020 until week 20 2021)

    Week 42 - 22 (week 42 2020 until week 22 2021)

    Week 45 - 25 (week 45 2020 until week 25 2021)

     

    These will be overlapping dates, so for example 2020/12/25 will fall under all 3 of the options above.