Forum Discussion
Calcualte Difference/% Change between two rows.
- 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])))
Anonymous ,
As a new colum
maxx(filter(table, [date] =earlier([Date])-1),[SPX Price])
As a measure
This Day = CALCULATE(max([SPX Price]), FILTER(ALL('Date'),'Date'[Date]=max('Date'[Date])))
This Day = CALCULATE(max([SPX Price]), previousday('Date'[Date]))
Anonymous ,
New columns if dates are not continous. In case date are continous the first formula I provided should be user. Earlier is powerful but costly. So should reduce the scope.
last Date = maxx(filter(table, [date] <earlier([Date])-1),[[date]])
last Value = maxx(filter(table, [date] =earlier(last Date)),[SPX Price])
Measure Non continous
Last Day Non Continous = CALCULATE(max([SPX Price]),filter(all('Date'),'Date'[Date] =MAXX(FILTER(all('Date'),'Date'[Date]<max('Date'[Date])),'Date'[Date])))
- calerof6 years ago
Impactful Individual
I have a problem with the last expression of the formula: "table[Date]", it doesn't fit, as the rest of the elemtents are calling the Date table and this last one is the date in the fact table.
F
- amitchandak6 years ago
Super User
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])))
- calerof6 years ago
Impactful Individual