Forum Discussion
nasbkrv
6 years agoRegular Visitor
Previous row value formula
Hi Team, I read this post: https://community.powerbi.com/t5/Desktop/Calculated-column-From-To-formula/td-p/1274376 and it works for me too, but not for every row. The given example is: And...
- 6 years ago
Hi nasbkrv ,
Please add an Index column in Power Query Editor first. And then, create calculated columns like so:
From = CALCULATE ( SUM ( 'Table'[Metric] ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[ID] ), 'Table'[Index] < EARLIER ( 'Table'[Index] ) ) ) + 0To = 'Table'[From] + 'Table'[Metric]Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
6 years agoSuper User
nasbkrv , In that you have to add an index column and try
https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi
Maxx(filter(table,[Index]=earlier([Index])-1),[Metric])