Forum Discussion
Aruna_ln
9 years agoHelper III
I need previous values- currentvalues same column
hello everybody, i have table amount cumilative diff 2 2 3 3 5 1 1 6 7 7 ...
- 9 years ago
In Power BI desktop data model, there are no orders for the records in your dataset. If you want to get previous value and calculated the different, you should have a order column. Please refer to the steps below to see the details.
- Edit your query>Add Column>Index Column>From 1
- Cumilative column
Cumilative = CALCULATE(SUM(Table1[Amount]),FILTER(Table1,Table1[Index]<=EARLIER(Table1[Index]))) - Diff = Table1[Amount]-LOOKUPVALUE(Table1[Amount],Table1[Index],Table1[Index]-1)
Regards,
Charlie Liao
- Edit your query>Add Column>Index Column>From 1
v-caliao-msft
9 years agoMicrosoft Employee
In Power BI desktop data model, there are no orders for the records in your dataset. If you want to get previous value and calculated the different, you should have a order column. Please refer to the steps below to see the details.
- Edit your query>Add Column>Index Column>From 1
- Cumilative column
Cumilative = CALCULATE(SUM(Table1[Amount]),FILTER(Table1,Table1[Index]<=EARLIER(Table1[Index]))) - Diff = Table1[Amount]-LOOKUPVALUE(Table1[Amount],Table1[Index],Table1[Index]-1)
Regards,
Charlie Liao