Forum Discussion
Conditional sum based on next row
- 4 years ago
Anonymous , change like
new column = if( table[index] < max(table[Index]), sumx(filter(Table, [index] > earlier([index]) ) , [Value]) ,table[Index])
Sorry, I did not notice that
both the columns are not incremental , column (Type) is a phase & it has to be in sequence .
Anonymous , Better to an index column in power query and try, the last formula. I shared a link for index column, if needed
- Anonymous4 years agoNot applicable
I did add the index column , its working fine till the 2nd last row , I need to repeat the last row value as is , how I can I do that ?
I used the below formula :
new column = sumx(filter(Table, [index] > earlier([index]) , [Value])
- amitchandak4 years ago
Super User
Anonymous , change like
new column = if( table[index] < max(table[Index]), sumx(filter(Table, [index] > earlier([index]) ) , [Value]) ,table[Index])
Sorry, I did not notice that
- Anonymous4 years agoNot applicable
yep its wokring fine , thanks alot .
- Anonymous4 years agoNot applicableIts working now for all scenario's , i've added IF condtion on top your formula:=IF (MAX(Sheet1[Index]) = Sheet1[Index],Sheet1[TotalCount],SUMX(FILTER(Sheet1,Sheet1[Index] > EARLIER(Sheet1[Index])),Sheet1[TotalCount]))