Forum Discussion
get value from Previous row
- 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
Hi,
In what order should the numbers appear in column B? Should they be in descending order?
Basically Do I need to do or get from the logic is something like this
Notice in the screeshot that I have 3 employees, every single employee has sales by month and the sum of sales is doing for every employee, no mixed up with a previous employee, that is the logic that I need in order to calculate the Sumed column
Thanks in advance for your help!!!
- Ashish_Mathur8 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_Muhammad8 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 !
- Anonymous3 years agoNot applicable
Hi,
I am really sorry for the inconvenience that occurred. Just forget about the first dataset I shared. In my previous email, I shared a Google sheet link with the dataset. Hope that would be helpful.
- Ashish_Mathur3 years agoSuper User
I still do n ot understand at all. Sorry.