Forum Discussion

Gabriel_Walkman's avatar
Gabriel_Walkman
Continued Contributor
5 years ago
Solved

Intertwined trees

Hi yall. I'm trying to figure out how to make relations to branches of a tree structure.

Here's my, I guess complicated, problem in a nutshell:

The exclamation marks in the "hoped for output" are the ones I'm missing.

I created a custom dax column for PATH in report structure and thus was able to achieve this:


But I'm having a really hard time figuring out how to get the whole B and E branches from the schemes table into consideration.

Here's a pbix with the test data.

Thanks in advance,
Gabe

  • It seems I managed to solve it by transforming 'scheme structure' into 'scheme parents' using dax new table:


    scheme parents =
    UNION(
    SELECTCOLUMNS('scheme structure', "id", [id], "parent_id", PATHITEM( [scheme path], 0, TEXT)),
    SELECTCOLUMNS('scheme structure', "id", [id], "parent_id", PATHITEM( [scheme path], 1, TEXT)),
    SELECTCOLUMNS('scheme structure', "id", [id], "parent_id", PATHITEM( [scheme path], 2, TEXT)),
    SELECTCOLUMNS('scheme structure', "id", [id], "parent_id", PATHITEM( [scheme path], 3, TEXT)),
    SELECTCOLUMNS('scheme structure', "id", [id], "parent_id", PATHITEM( [scheme path], 4, TEXT)),
    SELECTCOLUMNS('scheme structure', "id", [id], "parent_id", PATHITEM( [scheme path], 5, TEXT))
    )
     


    pbit for anyone interested

     

1 Reply

  • Gabriel_Walkman's avatar
    Gabriel_Walkman
    Continued Contributor

    It seems I managed to solve it by transforming 'scheme structure' into 'scheme parents' using dax new table:


    scheme parents =
    UNION(
    SELECTCOLUMNS('scheme structure', "id", [id], "parent_id", PATHITEM( [scheme path], 0, TEXT)),
    SELECTCOLUMNS('scheme structure', "id", [id], "parent_id", PATHITEM( [scheme path], 1, TEXT)),
    SELECTCOLUMNS('scheme structure', "id", [id], "parent_id", PATHITEM( [scheme path], 2, TEXT)),
    SELECTCOLUMNS('scheme structure', "id", [id], "parent_id", PATHITEM( [scheme path], 3, TEXT)),
    SELECTCOLUMNS('scheme structure', "id", [id], "parent_id", PATHITEM( [scheme path], 4, TEXT)),
    SELECTCOLUMNS('scheme structure', "id", [id], "parent_id", PATHITEM( [scheme path], 5, TEXT))
    )
     


    pbit for anyone interested