Forum Discussion
Anonymous
4 years agoNot applicable
Conditional sum based on next row
Hi, I have a requirement to calculate the total for the current row based on the next rows using DAX : Data Set : Type Value Rule Expected Result A 10 B + C +D +E 250 B 20 C + ...
- 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
amitchandak
4 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
Anonymous
4 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 agoSuper 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 .