Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Calculating the Difference between two averages

Hello! I would like to ask you for some advices how to calculate one new measure based on column rebate average%, MSE SD%, Total SD% seperately.    Example based on total SD% column: 1. Average f...
  • BarnabasToth's avatar
    4 years ago

    Hi there,

    You can use this approach (see link for file๐Ÿ˜ž

    Difference compared to average =
    
    VAR AverageOfValue = AVERAGE('Table'[Value])
    
    VAR AverageOfTotal = 
    CALCULATE(
        AVERAGE('Table'[Value]),
        ALLSELECTED('Table'[Chain])
    )
    
    VAR Result = AverageOfValue - AverageOfTotal
    
    RETURN
    Result

     

    Using ALLSELECTED changes the average at the total row in case only a subset of chains are selected.

    If this answers your question, please mark this as a solution.

    Regards,
    Barna