Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Aggregate Month values over Several Years

I have a table of sales that I want to get the average of each month over 3 years.   E.g.  If 'Date'[Month] = January then return the AVERAGEX(VALUES) of Sales for Jan 2007, Jan 2008, Jan 2009   ...
  • Icey's avatar
    Icey
    4 years ago

    Hi Anonymous ,

     

    Try this:

    Aggregation =
    CALCULATE (
        AVERAGEX ( VALUES ( 'Date'[Calendar Year] ), [Sales Amount] ),
        'Date'[Month] = MAX ( 'Date'[Month] ),
        DATESINPERIOD ( 'Date'[Date], MAX ( 'Date'[Date] ), -3, YEAR )
    )
    

     

     

     

    Best Regards,

    Icey

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.