Forum Discussion

Drshone's avatar
Drshone
Regular Visitor
1 year ago
Solved

Recursive custom function in Dataflow

I have a custom function that works fine in Power Query, but when I tried to move it to Dataflow during the refresh it breaks. I have read that in case of recursion in power query/dataflow "@" as inc...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Drshone ,

     

    Here's a simplified way to identify where the ‘@’ symbol might be needed:

     

    In your function, the recursive part seems to be in the fnAllParents definition. You can focus on this part.

     

    In this part, the List.Generate function is used to create a list of tables, where each table represents a level in the hierarchy. Recursion occurs in the each clause of List.Generate.

     

    To use the ‘@’ symbol, you can reference the function itself in the function definition. However, in Power Query M, the ‘@’ symbol is usually used to refer to the current scope of a function, especially nested functions. You should therefore make sure that the function reference is properly scoped and that there are no circular dependencies that would cause recursion to fail.

     

     

    Best Regards,

    Clara Gong

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