Forum Discussion

jksl_12's avatar
jksl_12
New Member
2 years ago
Solved

Difference between two values from seperate dates with refresh option

Hey there,    I have been running into the issue that I have a dataset that consists of total values for various dates throughout the year that is reported into the same dataset.    I want to set...
  • dadb25's avatar
    2 years ago

    Hi jksl_12,

    I think you want to have this result :

    You can use this measure :

     

    Dif with Max Date =
    VAR MaxDate =
    CALCULATE ( MAX ( 'Feuil2'[Date] ), ALL ( Feuil2[Date] ) )
    VAR AmountMaxDate =
    CALCULATE ( SUM ( 'Feuil2'[Amount] ), 'Feuil2'[Date] = MaxDate )
    RETURN
    SUM ( Feuil2[Amount] ) - AmountMaxDate
     
    If a new date comes in your data, it will take its value.
    Hope it helps 😀!
    Regards