Forum Discussion
Issues Using PATH Function with Multiple Root Nodes in Product Hierarchy
- Anonymous1 year ago
Hi Anonymous ,
Thanks for confirming. You're correct, since PATH() requires a strict one-parent-per-child hierarchy, it won’t work for scenarios like yours with many-to-many relationships. Exploring alternatives like bridge tables or custom logic is the right direction.
Thank you.
Hi Anonymous ,
I appreciate the clarification. Based on your update, the error you're encountering indicates that the product 424000050 is associated with multiple parent nodes, meaning your data represents a many-to-many relationship rather than a strict parent-child hierarchy.
The PATH() function in DAX is specifically designed for strict hierarchies, where each child has only one direct parent. When a single node (like 424000050) has multiple parents, PATH() cannot determine a single lineage and thus fails with the error you're seeing.
To resolve this, If your reporting scenario allows, consider introducing a primary parent for such products to enforce a single-parent structure, making it compatible with PATH().
If retaining all parent relationships is critical, you may need to move away from PATH() and instead consider modeling the hierarchy using a bridge table or exploring custom DAX logic to traverse relationships manually. Alternatively, network graph visuals or external processing tools may better suit this kind of structure.
Hope this clear your issue. Please feel free to reach out, if you need any further assistance
Thank you.