Forum Discussion
Rigoleto
8 years agoHelper II
get value from Previous row
Need a funtion or logic to read a previous row, for instance: How can you see Do I need is to sum up the previos record and build a new column with those values Ap...
- 8 years ago
I think this calculated column would work.
See the attached sample file as well
Calculated Column = VAR PreviousRow = TOPN ( 1, FILTER ( Table1, Table1[Month] < EARLIER ( Table1[Month] ) && Table1[Employee] = EARLIER ( Table1[Employee] ) ), [Month], DESC ) VAR PreviousValue = MINX ( PreviousRow, [Sales] ) RETURN Table1[Sales] + PreviousValue
Anonymous
3 years agoNot applicable
Hi Ashish,
We are calculating this for the current month onwards. If there are balance values we take it as an opening balance.
E.g:
| Month | July(Opening Balance) | Aug | Sep | Oct | Nov | Dec | Jan | Feb | Mar |
| Budget Sales | 1747364 | 1559823 | 2818704 | 2547503 | 2909010 | 2237380 | 2558905 | 2017217 | |
| Probable Monthly Receipts - AR | 8,613,088 | 1878993 | 3063531 | 2738160.92 | 763420.5 | 0 | 0 | 0 | 0 |
| Probable Monthly Receipts - Budget Sales | 0 | 0 | 0 | 0 | 1559823 | 2818704 | 2547503 | 2909010 | |
| Exposure | 8,481,459 | 6,977,751 | 7,058,294 | 8,842,377 | 10,191,564 | 9,610,240 | 9,621,642 | 8,729,849 |
Here I want to get a measure for the Exposure row. That's the place I got confused about how to get a previous value and iterate the value over months.
Ashish_Mathur
3 years agoSuper User
Hi,
That does not look like the raw dataset - that is the matrix view. Share the raw dataset from where that matrix has to be built.