Forum Discussion

ilcaa72's avatar
ilcaa72
Icon for Helper IV rankHelper IV
8 years ago
Solved

if Min date then 0

    i am substracting the current value from previous months value with this formula (it seems like its working, even though the table doesnt display the diff but the card does)  BUT for the First ...
  • Anonymous's avatar
    Anonymous
    8 years ago

    Hello ilcaa72

     

    I made this, in my example works very well according to your requeriments, try it, and if doesn't work, I can work on another formula.

     

    DIFF =
    VAR Minimun_Date =
    CALCULATE ( MIN ( Date[Date] ), ALLSELECTED ( Date[Date] ) )
    VAR Date_to_Compare =
    MIN ( Date[Date] )
    RETURN
    IF (
    Date_to_Compare = Minimun_Date,
    0,
    SUMX ( MatchRate, MatchRate[Rate] )
    - CALCULATE (
    SUMX ( MatchRate, MatchRate[Rate] ),
    PREVIOUSMONTH ( MatchRate[Date] )
    )
    )

     

    Good Luck.