Forum Discussion
Measure ignore interaction with another visual
Hi nleuck_101 ,
Great question! You can definitely set it up so that your % change measure ignores the date selection from your line chart, while your total views measure still responds to it.
Just use REMOVEFILTERS or ALL on the date column inside your % change measure. This tells Power BI to always calculate the last two weeks based on the latest available date in your data, no matter what’s selected in the line chart.
% Change =
VAR LastAvailableDate =
CALCULATE(
MAX('Table'[Date]),
REMOVEFILTERS('Table'[Date])
)
VAR PrevPeriod =
CALCULATE(
SUM('Table'[Views]),
DATESINPERIOD('Table'[Date], LastAvailableDate, -14, DAY),
REMOVEFILTERS('Table'[Date])
)
VAR CurrentPeriod =
CALCULATE(
SUM('Table'[Views]),
DATESINPERIOD('Table'[Date], LastAvailableDate, 0, DAY),
REMOVEFILTERS('Table'[Date])
)
RETURN
IF(PrevPeriod = 0, BLANK(), (CurrentPeriod - PrevPeriod) / PrevPeriod)
Your Total Views measure can remain as it is, so it’ll still react to date selections on your line chart. For the % change, using REMOVEFILTERS('Table'[Date]) ensures it always gives you the change over the latest two weeks, regardless of what’s selected elsewhere.
- Anonymous1 year agoNot applicable
Hi nleuck_101 ,
Thanks for rohit1991's and Bibiano_Geraldo's reply!And nleuck_101 , I'm sorry you haven't solved your problem yet, but with DAX alone it's actually very difficult for us to help you find your exact solution. Can you provide us with the data of all your data tables (with sample data instead of real data) and the relationship between each table? This will help us to understand your problem and find an accurate solution, thanks!
Best Regards,
Dino Tao