Forum Discussion
Why am I getting a circular reference ?
Hi,
I have the following column created:
Hi EaglesTony - Since you’re calculating the total for each parent, ensure you’re only referencing static columns rather than calculated columns that might cause loops.
TotChildCountDonePoints =
VAR curParent = ParentWithTheirIssues[Key]
VAR final =
CALCULATE(
SUM(ParentWithTheirIssues[Issues.Story_Points_10023]),
FILTER(
ALL(ParentWithTheirIssues),
ParentWithTheirIssues[Key] = curParent
&& ParentWithTheirIssues[TranslatedStatus] = "Done"
)
)
RETURN IF(final = BLANK(), 0, final)Once you’ve created the TotChildCountDonePoints column as shown above, you can now create the DoneDisplayPoints column as a string representation of the TotChildCountDonePoints
calculated column:
DoneDisplayPoints =
"(" & CONVERT(ParentWithTheirIssues[TotChildCountDonePoints], STRING) & ")"Hope this clear the issue.
7 Replies
- rajendraongole1Super User
Hi EaglesTony -Using measures avoids circular dependency issues.You can move the logic for TotChildCountDonePoints into a measure, and then use it in the calculation for DoneDisplayPoints.
create a measure:
TotChildCountDonePoints_Measure =
VAR curParent = SELECTEDVALUE(ParentWithTheirIssues[Key])
RETURN CALCULATE(
SUM(ParentWithTheirIssues[Issues.Story_Points_10023]),
ParentWithTheirIssues[Key] = curParent && ParentWithTheirIssues[TranslatedStatus] = "Done"
)display it using the following in measure
DoneDisplayPoints =
"(" & CONVERT([TotChildCountDonePoints_Measure], STRING) & ")"Hope this helps.
- EaglesTonyPost Prodigy
The problem with the measure, is it can't find: ParentWithTheirIssues[Key]
- rajendraongole1Super User
Hi EaglesTony - Since you’re calculating the total for each parent, ensure you’re only referencing static columns rather than calculated columns that might cause loops.
TotChildCountDonePoints =
VAR curParent = ParentWithTheirIssues[Key]
VAR final =
CALCULATE(
SUM(ParentWithTheirIssues[Issues.Story_Points_10023]),
FILTER(
ALL(ParentWithTheirIssues),
ParentWithTheirIssues[Key] = curParent
&& ParentWithTheirIssues[TranslatedStatus] = "Done"
)
)
RETURN IF(final = BLANK(), 0, final)Once you’ve created the TotChildCountDonePoints column as shown above, you can now create the DoneDisplayPoints column as a string representation of the TotChildCountDonePoints
calculated column:
DoneDisplayPoints =
"(" & CONVERT(ParentWithTheirIssues[TotChildCountDonePoints], STRING) & ")"Hope this clear the issue.
- EaglesTonyPost Prodigy
Anybody got any ideas ?
I have this, which is good:
TotChildCountDoneStoryPts =var curParent = FeaturesWithTheirIssues[Key]var final =CALCULATE(SUM(FeaturesWithTheirIssues[Issues.Story_Points_10023]),FILTER(ALL(FeaturesWithTheirIssues[TranslatedStatus]),FeaturesWithTheirIssues[Key] = curParent && FeaturesWithTheirIssues[TranslatedStatus] = "Done"))RETURN IF(final = BLANK(),0,final)I am trying to display the result as, but get the circular reference error:DoneDisplayPoints ="(" & CONVERT(FeaturesWithTheirIssues[TotChildCountDoneStoryPts], STRING) & ")"