Forum Discussion
Anonymous
6 years agoNot applicable
Calcualte Difference/% Change between two rows.
Hi there, I have the following data: Date SPX Price Volume 7/9/2020 3152.05 4829020000 7/8/2020 3169.94 4927700000 7/7/2020 3145.32 4563700000 7/6/2020 3179.72 473645...
- 6 years ago
calerof , the correct version. Value replacement issue in my formula
Last Day Non Continuous = CALCULATE([sales],filter(ALLSELECTED('Date'),'Date'[Date] =MAXX(FILTER(ALLSELECTED('Date'),'Date'[Date]<max('Date'[Date])),'Date'[Date])))
az38
Community Champion
6 years agoHi Anonymous
try a measure like
Measure =
var _prevDate = CALCULATE(MAX(Table[Date]), Table[Date] < MAX(Table[Date]))
var _prevPrice = CALCULATE(MAX(Table[SPX Price]), Table[Date] = _prevDate )
RETURN
DIVIDE(MAX(Table[SPX Price]), _prevPrice)
Anonymous
6 years agoNot applicable
"A function 'MAX' has been used in a True/False expression that is used as a table filter expression. This is not allowed."
That is the error that comes with the measure.
- az386 years ago
Community Champion
Anonymous
yes, sorry
Measure = var _curDate = MAX(Table[Date]) var _prevDate = CALCULATE(MAX(Table[Date]), Table[Date] < _curDate ) var _prevPrice = CALCULATE(MAX(Table[SPX Price]), Table[Date] = _prevDate ) RETURN DIVIDE(MAX(Table[SPX Price]), _prevPrice)