Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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 + D + E | 230 |
| C | 50 | D + E | 180 |
| D | 80 | E | 100 |
| E | 100 | E | 100 |
How I can solve this .
Thanks.
Solved! Go to Solution.
@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])
both the columns are not incremental , column (Type) is a phase & it has to be in sequence .
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])
@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
yep its wokring fine , thanks alot .
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 33 | |
| 29 |
| User | Count |
|---|---|
| 132 | |
| 90 | |
| 78 | |
| 66 | |
| 65 |