Forum Discussion
Create Hierarchy column using Path function on persons data
- 1 year ago
Hi satishorre20 ,
This issue often occurs when a date filter such as 2025-04-15 is applied. Instead of returning only the records valid on that date, the model processes the entire history, which can result in multiple supervisor IDs per person and disrupt the expected behavior of visuals or hierarchy logic.
To address this, I revised the logic as follows
- The table is initially filtered to include only the rows valid for the selected date (where [Start Date] <= selected date <= [End Date])
- This approach ensures that each ID has only one active supervisor in the current context
- The PATH() function is executed after scoping the data, resulting in accurate and clean hierarchies
- Because the process is controlled by the slicer, it updates automatically with any date change
This results in a dynamic model that accurately reflects the reporting date, eliminates ambiguity, and ensures that visuals such as matrices or trees function correctly, without the need for flattening or static solutions.
The PBIX file is attached for your reference. Please let me know if you need any adjustments in the future.
Regards,
Yugandhar.
Hi,
you have the same ID for different people? In that case you need to create a unique key, otherwise you are getting an error that says that it seems that the same person has different supervisors. Maybe you can concatenate the ID with the start date and try on that column
Please give kudos if this helped and/or mark it as a solution if it solved