Forum Discussion
67nmark
6 years agoHelper I
DAX calculated column- get previous record value
Hello, I've looked for answers but can't get what I want. Essentially I need a column that brings the value associated with a previous date onto the current row. The image below shows the requirement...
- 6 years ago
Try this
Last Val = CALCULATE(LASTNONBLANK('Table'[Value],'Table'[Value]),FILTER(ALLEXCEPT('Table','Table'[Name]),'Table'[Date]<EARLIER('Table'[Date])))
amitchandak
6 years agoSuper User
67nmark , As a measure with date table
Last Day Non Continuous = CALCULATE(Table[Value],filter(ALLSELECTED('Date'),'Date'[Date] =MAXX(FILTER(ALLSELECTED('Date'),'Date'[Date]<max('Date'[Date])),'Date'[Date])))
as a column
Last day value =
var _max = maxx(filter(Table, [date] < earlier([date]) && [name] = earlier([name])),[date])
return
maxx(filter(Table, [date] = _max && [name] = earlier([name])),[value])
same is discussed in