Forum Discussion
Dunner2020
Post Prodigy
6 years agoCreating new column values based on previous rows value
Hi there, I have a table that contains 3 columns (index, Waste Value, Running total of waste value). I want to create or populate new column/measure (let say called Replaced Value) in such a way...
Dunner2020
Post Prodigy
6 years agoBut how do we select the number of earlier observations? I have also added the sample data.
amitchandak
Super User
6 years agoQuestion is not clear, But you can try like this. Both are new columns
Last Date Time = maxx(filter(table,table[Date Time]<earlier(table[Date Time])),table[Date Time])
Last value = maxx(filter(table,table[Date Time] =earlier(table[Last Date Time])),table[value])
.
- Dunner20206 years ago
Post Prodigy
Hi amitchandak
Sorry for the confusion, I have added more explanation. Hopefully that make sense now.