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.
- Anonymous3 years agoNot applicable
Hi Ashish,
Hope this will work.
Month-Year Budget Value Current AR Probable Monthly Receipts - Budget Sales AR Value 1-Jul-23 7,849,667 1-Aug-23 1747364 1,918,697 1878993 1-Sep-23 1559823 0 1,825,650 3063531 1-Oct-23 2818704 0 1,747,364 2738161 1-Nov-23 2547503 0 1,559,823 0 1-Dec-23 2909010 0 2,818,704 0 1-Jan-24 2237380 0 2,547,503 0 1-Feb-24 2558905 0 2,909,010 0 1-Mar-24 2017217 0 2,237,380 0 - Ashish_Mathur3 years agoSuper User
Hi,
Share the download link of the working Excel file which you showed on Sunday. I need to check something in the formulas there.
- Anonymous3 years agoNot applicable