Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
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
User | Count |
---|---|
13 | |
8 | |
8 | |
7 | |
5 |
User | Count |
---|---|
23 | |
15 | |
15 | |
10 | |
7 |