Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

SUM multiple month values over years

I'm trying to sum multiple month values over several years e.g. Jan 2007, Jan 2008, Jan 2009.   I'm using the following formula however when I try push the date forward 12 months it comes back to t...
  • v-janeyg-msft's avatar
    v-janeyg-msft
    4 years ago

    Anonymous 

     

    Try:

    Aggregation 3 =
    IF (
        ISINSCOPE ( 'Date'[Month] ),
        CALCULATE (
            SUMX ( Sales, Sales[Quantity] * Sales[Net Price] ),
            ALLEXCEPT ( 'Date', 'Date'[Month] )
        ),
        SUMX (
            FILTER (
                ALL ( Sales ),
                YEAR ( [Order Date] ) <= SELECTEDVALUE ( 'Date'[Calendar Year Number] )
            ),
            Sales[Quantity] * Sales[Net Price]
        )
    )
    

     

    Did I answer your question ? Please mark my reply as solution. Thank you very much.
    If not, please upload some insensitive data samples and expected output.


    Best Regards,

    Community Support Team _ Janey