Forum Discussion

PANDAmonium's avatar
PANDAmonium
Resolver IV
3 years ago
Solved

Find the Loop

Hi All,   I have a dataflow that transform a parent child table to a table where you can select the parent and filter to their children/grandchildren, etc.   So from: Parent | Child A | B B | ...
  • v-xiaosun-msft's avatar
    3 years ago

    Hi PANDAmonium ,

     

    If the relationships in your data are ambiguous, i.e. items stand in parent-child as well as child-parent-relationship to each other, and endless loop would occur. 

    You can reference the following document to create "EndlessLoops" and "IsEndlessLoop" in order to check the loop.

    And then create a custom column.

    Custom1 = if IsEndlessLoop then [Message= "The data is in an endless loop. Check Table in  ""Endless Loop""", #" Endless Loop"= LastIteration] meta [ResultsSoFar = RemainingResults] else IsLeaf
    in
        Custom1

    Dynamically flatten Parent-Child Hierarchies in DAX and PowerBI – The BIccountant

     

    Best Regards,
    Community Support Team _ xiaosun

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.