Forum Discussion

JoRo50's avatar
JoRo50
Frequent Visitor
4 years ago
Solved

calculation to show value for NOT variable

Hello,  I'm trying to create a measure to show a calculation for values other than the variable indicated in the row label.  For instance, in the data below (Table), I want to be able to do a calcul...
  • AUaero's avatar
    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.