Forum Discussion

Zoeynguyen's avatar
Zoeynguyen
Frequent Visitor
1 year ago
Solved

Need help with Slicer/Filter/Selectedvalue

Hi,

Can you pls help me set up a month drop-down slicer or a date parameter that can:

- Filter that month for some visuals

- Filter that month and previous 11 months for other visuals

 

I tried Selectedvalue but the way I set up must be wrong so it didn't work. Please help. Thank you

  • Hi Zoeynguyen 
    You can solve it by creating two separate measures — one that only respects the month selected in the slicer, and another that calculates the selected month plus the previous 11 months.

    For example for selected month a standart measure like :
    Total Revenue=SUM ( Data[Revenue] )
    Revenue (Selected + Last 11 Months) =
    VAR EndDate = EOMONTH( MAX('Dates'[Date]), 0 )
    VAR StartDate = EOMONTH( EndDate, -11 )
    RETURN
    CALCULATE(
    [Total Revenue],
    ALL('Dates'),
    DATESBETWEEN('Dates'[Date], StartDate, EndDate)
    )

     For the measures  Selected month + previous 11 months – thne measures should ignore the visual’s current date filter and apply a relative 12-month window.

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

5 Replies