Forum Discussion
abadi_89
5 years agoFrequent Visitor
Last 2 months difference measure
Hello all, This is driving me crazy, I tried alot of stuff but it looks I can't do it. I have this table: CS Code CS Name Date Value CS01 Ketchup 1/6/2020 0.946375 CS01 Ketchup ...
- 5 years ago
Hi abadi_89
you can di it like this:
Measure = VAR _MaxDate = MAX('Table'[Date]) VAR _PreviousDate = CALCULATE(MAX('Table'[Date]),'Table'[Date] < _MaxDate) VAR _ValueOfMaxDate = CALCULATE(MAX('Table'[Value]),FILTER('Table',_MaxDate = 'Table'[Date])) VAR _ValueOfPreviousDate = CALCULATE(MAX('Table'[Value]),FILTER('Table',_PreviousDate = 'Table'[Date])) RETURN _ValueOfMaxDate - _ValueOfPreviousDateWith kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)
FrankAT
Community Champion
5 years agoHi abadi_89
you can di it like this:
Measure =
VAR _MaxDate = MAX('Table'[Date])
VAR _PreviousDate = CALCULATE(MAX('Table'[Date]),'Table'[Date] < _MaxDate)
VAR _ValueOfMaxDate = CALCULATE(MAX('Table'[Value]),FILTER('Table',_MaxDate = 'Table'[Date]))
VAR _ValueOfPreviousDate = CALCULATE(MAX('Table'[Value]),FILTER('Table',_PreviousDate = 'Table'[Date]))
RETURN
_ValueOfMaxDate - _ValueOfPreviousDate
With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)
abadi_89
5 years agoFrequent Visitor
Thank you Frank! simply genius.
Have a good weekend.