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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
lekkerbek
Helper IV
Helper IV

parent-child hierarchy - duplicate error when trying to sort

Hi,

 

I created a parent -child hierarchy using path and pathitem. It has 5 levels (not really relevant).

When I try to sort each level it says that it cannot do it, because it has a duplicate value. In reality it doesn't have a duplicate value.

 

I used to have a link to a webpage which solved this issue, but stupid me, I deleted that. I'm pretty sure it has something to do with the path function, because when I copy the table to Excel and import it as an excelsheet in a new report it does let me sort the columns.

 

Any idea on how to solve it? Thank you.

 

Screenshot.jpg

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,@lekkerbek 

Regarding the issue you raised, my solution is as follows:

1.First of all, according to the information we have gathered about similar situations, the reason why the above situation may be related to your storage mode, only in the IMPORT storage mode, there will be reservations about the hierarchy, such as the Direct query mode, it may have an impact on your hierarchy.

You can view the storage schema of your table in the model view in powerbi.

vlinyulumsft_0-1715840933887.png

Here are the links to the relevant content:

Solved: Re: Using Power BI Hierarchies in Excel - Page 2 - Microsoft Fabric Community

2.Please check if the duplicates in your parent-child columns are the same, in the PATH() function, if the duplicate child ids point to the same parent id then he will return the normal content, if the duplicate child ids point to different parent ids then there will be an error, quoting the example in the documentation is: if you have two lists of the same employee IDs and they have the same manager ID, then the The PATH() function will return the manager's ID, but if there are two identical employee IDs with different manager IDs, the PATH() function will return an error.

Here are the links to the relevant content:

PATH function (DAX) - DAX | Microsoft Learn

3.Please check that the parent and child columns you are calling contain calculated columns or that the table itself has RLS, as the PATHITEM() function does not support use in calculated columns or Row Level Security (RLS) rules in DirectQuery mode.

Here are the links to the relevant content:

PATHITEM function (DAX) - DAX | Microsoft Learn

4.Here is a link to the relevant documentation which I hope you find helpful:

Understanding functions for parent-child hierarchies in DAX - DAX | Microsoft Learn

Parent-child hierarchies – DAX Patterns

Best Regards,

Leroy Lu

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

1 REPLY 1
Anonymous
Not applicable

Hi,@lekkerbek 

Regarding the issue you raised, my solution is as follows:

1.First of all, according to the information we have gathered about similar situations, the reason why the above situation may be related to your storage mode, only in the IMPORT storage mode, there will be reservations about the hierarchy, such as the Direct query mode, it may have an impact on your hierarchy.

You can view the storage schema of your table in the model view in powerbi.

vlinyulumsft_0-1715840933887.png

Here are the links to the relevant content:

Solved: Re: Using Power BI Hierarchies in Excel - Page 2 - Microsoft Fabric Community

2.Please check if the duplicates in your parent-child columns are the same, in the PATH() function, if the duplicate child ids point to the same parent id then he will return the normal content, if the duplicate child ids point to different parent ids then there will be an error, quoting the example in the documentation is: if you have two lists of the same employee IDs and they have the same manager ID, then the The PATH() function will return the manager's ID, but if there are two identical employee IDs with different manager IDs, the PATH() function will return an error.

Here are the links to the relevant content:

PATH function (DAX) - DAX | Microsoft Learn

3.Please check that the parent and child columns you are calling contain calculated columns or that the table itself has RLS, as the PATHITEM() function does not support use in calculated columns or Row Level Security (RLS) rules in DirectQuery mode.

Here are the links to the relevant content:

PATHITEM function (DAX) - DAX | Microsoft Learn

4.Here is a link to the relevant documentation which I hope you find helpful:

Understanding functions for parent-child hierarchies in DAX - DAX | Microsoft Learn

Parent-child hierarchies – DAX Patterns

Best Regards,

Leroy Lu

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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