Forum Discussion

satkin's avatar
satkin
Advocate I
3 years ago
Solved

Filter dates using two slicers (From / To)

Hi,
I'm wanting to have two slicer on my page, Quarter From and Quarter To.  I've set these up as independnet slicers by creating two tables, Quarter From and Quarter To that are created using the SUMMARIZE function reading from my date table. This means I can make independnet selections in the two slicers.  I don't know how to the apply these selections to the actual date table though, so that my selected range is all that is reported on.  Currenly my visuals continue to show all Quarters in the dates table, rather than just those in the selected range.

I know this would be easy with a single slicer to choose a date range, but unfortunately I need to have the two options as slicers.

 

Date Table

 

DateQuarter
01/10/20222022Q4
...2022Q4
31/12/20232022Q4
01/01/20232023Q1
...2023Q1
31/03/20232023Q1
01/04/20232023Q2
...2023Q2
31/05/20232023Q2

 

Quarters From / Quarters To

2022Q4
2023Q1
2023Q2

 

Measures

Selected From =
CALCULATE(
    MIN(Dates[Date]),
    Dates[Quarter] = 'Quarter From'[Quarter]
)

Selected To =
CALCULATE(
    MAX(Dates[Date]),
    Dates[Quarter] = 'Quarter To'[Quarter]
)

 

If I select 2023Q1 in my From slicer and 2023Q2 in my To slicer, any visual will show all 3 quarters in it when I use Quarter from the Dates table in the visual.  Can I get it to be dynamic to the selected quarterly values?

 

Many thanks