Forum Discussion

RAdams's avatar
RAdams
Icon for Helper III rankHelper III
4 years ago
Solved

Path for Hierarchy showing in wrong direction

I'm working on Creating a Hierarchy using Path. However, I'm expecting different results than what I'm getting. 

 

For row where SalesRepresentativeID = 6, I'm expecting the Path column to be 6|807 rather than 807|6. 

 

I'm suspecting it's because I have blank rows in the ID column but can someone confirm this or if there is a workaround? 

 

Any help would be appreciated! R

 

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi RAdams ,

     

    I think your guess is right.

    Some interesting facts about PATH function are below:

                    

      • The path is not tied to a single level of parent-child relationships. It can return related rows that are several levels up from the specified starting row.
      • The values in Child_columnName and Parent_columnName must have the same data type, text or integer.
      • Values in Parent_columnName must be present in Child_columnName. That means you cannot look up a parent if there is no value at the child level.
      • If Parent_columnName is BLANK then PATH() returns Child_columnName value. 
      • If Child_columnName has duplicates and Parent_columnName is the same for those duplicates then PATH() returns the common Parent_columnName value; however, if Parent_columnName value is different for those duplicates then PATH() returns an error. 
      • If Child_columnName is BLANK then PATH() returns BLANK.
      • If Child_columnName contains a vertical bar ‘|’ then PATH() returns an error.
      •  The delimiter used to separate the ascendants is the vertical bar, ‘|’.

    For more information,please refer to:Power BI – PATH function for Parent-child Hierarchies in DAX 

     

     

    Hope it helps,


    Community Support Team _ Caitlyn

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

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi RAdams ,

     

    I think your guess is right.

    Some interesting facts about PATH function are below:

                    

      • The path is not tied to a single level of parent-child relationships. It can return related rows that are several levels up from the specified starting row.
      • The values in Child_columnName and Parent_columnName must have the same data type, text or integer.
      • Values in Parent_columnName must be present in Child_columnName. That means you cannot look up a parent if there is no value at the child level.
      • If Parent_columnName is BLANK then PATH() returns Child_columnName value. 
      • If Child_columnName has duplicates and Parent_columnName is the same for those duplicates then PATH() returns the common Parent_columnName value; however, if Parent_columnName value is different for those duplicates then PATH() returns an error. 
      • If Child_columnName is BLANK then PATH() returns BLANK.
      • If Child_columnName contains a vertical bar ‘|’ then PATH() returns an error.
      •  The delimiter used to separate the ascendants is the vertical bar, ‘|’.

    For more information,please refer to:Power BI – PATH function for Parent-child Hierarchies in DAX 

     

     

    Hope it helps,


    Community Support Team _ Caitlyn

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

    • RAdams's avatar
      RAdams
      Icon for Helper III rankHelper III

      Thanks Caitlyn for the info. Much appreciated.