Forum Discussion
jksl_12
2 years agoNew Member
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...
- 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] ) - AmountMaxDateIf a new date comes in your data, it will take its value.Hope it helps 😀!Regards
dadb25
2 years agoHelper I
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
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
jksl_12
2 years agoNew Member
Thank you that does look like very much what I want! I will give it a try tomorrow because my brain is too fried to be doing it today😅
If it works as I suspect it will I will of course come back and give you a thanks for the help 🙂