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
Anonymous , if the type or value are incremental in nature try a new column like below. Or add an index column in power query and use that https://stackoverflow.com/questions/45715963/creating-an-index-column-for-power-bi
new column = sumx(filter(Table, [Type] > earlier([Type]) , [Value])
or
new column = sumx(filter(Table, [Value] > earlier([Value]) , [Value])
or
new column = sumx(filter(Table, [index] > earlier([index]) , [Value])
- Anonymous4 years agoNot applicable
both the columns are not incremental , column (Type) is a phase & it has to be in sequence .
- amitchandak4 years agoSuper User
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])