Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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 :

TypeValueRuleExpected Result
A10B + C +D +E250
B20C + D + E230
C50D + E180
D80E100
E100E100

 

How I can solve this .

Thanks.

  • 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

7 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      both the columns are not incremental , column (Type) is a phase & it has to be in sequence . 

      • amitchandak's avatar
        amitchandak
        Super User

        Anonymous , Better to an index column in power query and try, the last formula. I shared a link for index column, if needed