Forum Discussion
Anonymous
2 years agoNot applicable
Iterative loop in DAX
Hello Everyone, I'm trying to find a way to iterative loop through a previous calculation that will be created by a calculated column in DAX. I have to replace an existing .vb application with a ...
aduguid
2 years agoMemorable Member
Try this measure.
PAC =
VAR CurrentRowID = [RowID] -- Assuming you have a unique identifier for each row
VAR PrevPAC =
CALCULATE(
SUM([TACC]),
FILTER(
ALL('YourTable'),
'YourTable'[RowID] < CurrentRowID
)
)
RETURN IF(ISBLANK(PrevPAC), 0, PrevPAC) + [TACC]
Anonymous
2 years agoNot applicable
aduguid I do not have one but I can create one. Would it be better to create RowID in M or DAX? Does it matter? Also does it need to be a measure or can it be a calculated column?
I tried as a calculated column and I still get circular dependency error.