Forum Discussion
Need help with Slicer/Filter/Selectedvalue
- 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
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