Forum Discussion
Removing Filter Context
Hi,
Sorry for delayed reply. Here is the measure, I'm using this measure in the y-axis of the custom tooltip and date from my calendar table in the x-axis
SEC 3-Month Rolling =
VAR SelectedMonthYear = SELECTEDVALUE('Calendar'[MonthYear])
VAR SelectedYear = VALUE(LEFT(SelectedMonthYear, 4))
VAR SelectedMonth = VALUE(RIGHT(SelectedMonthYear, 2))
VAR CurrentDate = DATE(SelectedYear, SelectedMonth, 1)
-- Calculate start and end dates for the 3-month period
VAR EndDate = EOMONTH(CurrentDate, 0)
VAR StartDate = EOMONTH(CurrentDate, -2) + 1
-- Calculate SEC (kWh/ML) for the date range
RETURN
CALCULATE(
[SEC (kWh/ML)], -- Use the existing measure
REMOVEFILTERS('Calendar'[MonthYear]), -- Remove the MonthYear filter context
DATESBETWEEN(
'Calendar'[Date],
StartDate,
EndDate
)
)
What you can see in the image (redacted), is a table with 25 facility names and their respective correlation coefficients based on Year-Month slicer (visible). The custom tooltip works perfectly in the context of the 1-month view, as its being governed by the YearMonth slicer. However, I have a toggle (also visible) where I switch a second table that shows the same 25 facilities but, this time with correlation coefficients for the 3-months (the chosen YearMonth and 2 months prior). Despite, what I have tried, I can't seem to show 3-months of data in the custom tooltip. You can clearly see the line is flat, as the measure isn't working. In a previous iteration of the report, I had 2 separate slicers, each controlling their respective table, but I have been asked by a stakeholder specifically to have only 1 slicer on the page. Any help would be much appreciated. Thanks