Forum Discussion
calculation to show value for NOT variable
- 4 years ago
Using the data table you provided, you can create two measures to get the desired result:
# Avg Value = AVERAGE(FilterTable[Value])# Avg Not Value = VAR ThisVariable = MAX(FilterTable[Variable]) RETURN CALCULATE( [# Avg Value], FILTER( ALL(FilterTable), NOT(FilterTable[Variable] = ThisVariable) ), VALUES(FilterTable[Filter]) )Here are the results when no Filter slicer is applied:
And with the Filter slicer:
Please accept this as the solution if this solves your problem.
Using the data table you provided, you can create two measures to get the desired result:
# Avg Value = AVERAGE(FilterTable[Value])# Avg Not Value =
VAR ThisVariable = MAX(FilterTable[Variable])
RETURN
CALCULATE(
[# Avg Value],
FILTER(
ALL(FilterTable),
NOT(FilterTable[Variable] = ThisVariable)
),
VALUES(FilterTable[Filter])
)Here are the results when no Filter slicer is applied:
And with the Filter slicer:
Please accept this as the solution if this solves your problem.
AUaero Is there a solution if I am being asked to add a second filter (Filter2) to this table? With 2 filters, the Not Value calculation should still calculate based on the values remaining after the filters have been selected.
(I also noticed that my example for Filter B, Variable Y should have an Avg Not Value of 18.5. Thank you for correcting that oversight.)
Thank you.