Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Summarizing the differences between months

Hello,   I am trying to summarize the differences between each month's values compared to the previous month in a matrix.   Right now, I have this measure, which results in the correct sums and ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hello

     

    The issue was fixed with the following syntax:

     

    Diff =
    VAR Diff =
    CALCULATE(SUMX('Data','Data'[EUR]) -CALCULATE(SUMX('Data','Data'[EUR]), PREVIOUSMONTH('Date Table'[Date])))
    VAR Total =
    CALCULATE(SUMX('Data','Data'[EUR]), FILTER('Data', 'Data'[Year/Month] = MAXX(ALL('Data'),'Data'[Year/Month]))) -CALCULATE(SUMX('Data','Data'[EUR]), PREVIOUSMONTH('Date Table'[Date]))

    RETURN
    IF(HASONEFILTER('Date Table'[Year-month]),Diff,Total)