Forum Discussion
Zoeynguyen
1 year agoFrequent Visitor
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 ...
- 1 year ago
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