Forum Discussion
Creating new column values based on previous rows value
Sample source data as text would aid tremendously. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
That being said, dealing with previous values in rows generally involves variables or EARLIER. See my article on Mean Time Between Failure (MTBF) which uses EARLIER: http://community.powerbi.com/t5/Community-Blog/Mean-Time-Between-Failure-MTBF-and-Power-BI/ba-p/339586
But how do we select the number of earlier observations? I have also added the sample data.
- amitchandak6 years agoSuper User
Question 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 agoPost Prodigy
Hi amitchandak
Sorry for the confusion, I have added more explanation. Hopefully that make sense now.