Forum Discussion

Pamiko's avatar
Pamiko
Regular Visitor
1 year ago
Solved

Deviation from average - how?

Hi All,   I have this table about monthly sales value, however in case I draw an average line, the differences are really small, so I would like to show deviation from average in a different bar ch...
  • danextian's avatar
    danextian
    1 year ago

    burakkaragoz 

    Another AI copy-paste without validation?

     

    Pamiko 

    Since Total is a measure, it doesn't need to be wrapped in CALCULATE - it is implicitly applied.

    This measure will not return the overall average for each month but simply the current month's value. It will at the total level.

    Monthly Average = 
    AVERAGEX ( ALL ( Dates[Month Short] ), [Total Revenue] )
    

     If you want the average to be applied to each month, modify the filter context by using CALCULATE

    Monthly Average CALCULATE = 
    CALCULATE (
        AVERAGEX ( VALUES ( Dates[Month Short] ), [Total Revenue] ),
        ALLSELECTED ( Dates ) --applies to all visible rows only, use ALL to apply to the whole Dates
    )