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
Ashish_Mathur
8 years agoSuper User
Hi,
Please share a meaningful dataset. While your column title is month, entries under that column are Sales 1, Sales 2. I am sure there are months/dates in that column. Please share a meaningful dataset with column names and data therein making sense so that i can frame a solution.
Zubair_Muhammad
8 years agoCommunity Champion
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- rrathod5 years agoFrequent Visitor
Zubair_Muhammad Thank you so much !
- Kamill113 years agoHelper I
Zubair_Muhammad
Can we easly rebuilt this to get value from FIRST existing row? I tried by MIN etc. in my case i have date, not only month. SO i want get value with first date.