Forum Discussion

EaglesTony's avatar
EaglesTony
Post Prodigy
1 year ago
Solved

Why am I getting a circular reference ?

Hi,

 

I have the following column created:

 

TotChildCountDonePoints =
 var curParent = ParentWithTheirIssues[Key]
 var final = CALCULATE(SUM(ParentWithTheirIssues[Issues.Story_Points_10023]),ParentWithTheirIssues[Key] = curParent && ParentWithTheirIssues[TranslatedStatus] = "Done")
 Return IF(final = BLANK(),0,final)
 
This works, now I want to display it using the following new column:
 
DoneDisplayPoints = "(" & CONVERT(ParentWithTheirIssues[TotChildCountDonePoints],STRING) & ") "
 
However, when I try this it is giving me an error ????
"A circular dependency was detected: ParentWithTheirIssues[TotChildCountDonePoints], ParentWithTheirIssues(Column), FeatureWithTheirIssues[TotChildCountDonePoints]
 
  • 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

  • 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.

    • EaglesTony's avatar
      EaglesTony
      Post Prodigy

      The problem with the measure, is it can't find: ParentWithTheirIssues[Key]

      • rajendraongole1's avatar
        rajendraongole1
        Super 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.

  • 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) & ")"