Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
RAdams
Helper III
Helper III

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

 

ApplicationFrameHost_2021-12-01_19-55-11.png

1 ACCEPTED SOLUTION
v-xiaoyan-msft
Community Support
Community Support

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.

View solution in original post

2 REPLIES 2
v-xiaoyan-msft
Community Support
Community Support

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.

Thanks Caitlyn for the info. Much appreciated. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.