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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi, Has anyone a idea how to solve this situation in DAX.
In Excel it is quite easy becasue you can always refer to a specific cell.
I need to increment the A Value by B Value, and if A is Blank the A increment should happen by the previous result of the calculation.
Thank You in advance!
I have my data setup like so (actually the 550 in the data isn't used at all, i just need the starting values for A and B and the number of rows to go up to... and the row and the starting values don't even need to be in the same table):
And then a measure:
Sum of A =
var firstAValue = CALCULATE(MIN(Cumulative[A]), Cumulative[Row] = 0)
var firstBValue = CALCULATE(MIN(Cumulative[B]), Cumulative[Row] = 0)
var currentRow = SELECTEDVALUE(Cumulative[Row])
var result = firstAValue * IF(currentRow = 0, 1, currentRow) + (firstBValue * (IF(currentRow = 0, 1, currentRow) - 1))
RETURN result
which you can adapt to get the value for B
Hi vicky_
Thank you for your help.
However it is still not working:
Any idea why this could fail?
PS. I made the same calculation on hard pasted data and it seems to work.
Above a have a summarisecolumn table.
I have my data setup like so (actually the 550 in the data isn't used at all, i just need the starting values for A and B and the number of rows to go up to... and the row and the starting values don't even need to be in the same table):
And then a measure:
Sum of A =
var firstAValue = CALCULATE(MIN(Cumulative[A]), Cumulative[Row] = 0)
var firstBValue = CALCULATE(MIN(Cumulative[B]), Cumulative[Row] = 0)
var currentRow = SELECTEDVALUE(Cumulative[Row])
var result = firstAValue * IF(currentRow = 0, 1, currentRow) + (firstBValue * (IF(currentRow = 0, 1, currentRow) - 1))
RETURN result
which you can adapt to get the value for B
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 6 | |
| 6 | |
| 5 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 18 | |
| 14 | |
| 14 |