Forum Discussion
Path function error
- 8 years ago
First off, there's a great blog post by the Italians on this topic here: Parent - Child Hierarchies. I've personally used their technique to successfully build a SSAS tab cube based upon essbase financial data with lots of ragged hierarchies.
Anyway, I believe I ran into this issue when I was building my cube. What I found was that there were "alternative hierarchies" in the base data that caused me to have duplicate "children." So in your application, I would examine your data. You likely have a member in the [person name] column that has multiple supervisors. Again, this may be because of an error in the base data and/or there's an alternative hierarchy listed in the data.
So I would go back to your query editor, remove duplicates from the [person name] column to test if your formulas will work then.
Person Name has unique values. There are obiously multiple occurences of supervisor, but that makes sense in an org hierarchy...
I just solved this issue for my hierarchy problem. My boss' people give Power BI training to all the peeps in the company. He wants me to create a hierarchy visual that shows all the high level managers (henceforth upper gods) and how many of their employees have taken the training. He wants to shame the upper gods in a meeting by throwing up a chart that shows who is not training their employees.
So I'm given a data dump with the two colums, all the peeps in the company and the second column who they report to. When I ran the Path Function the system kept telling me there were a ton of errors. I figured out that some of the data had to be cleaned up (mispelling of names) so I did that and it solved about 90% of the issues.
The second issue is that Power BI kept telling me that there were duplicates in the first colunm that had to be removed but it was OK to have dups in the second column because multiple people in the company report to the same boss. Hence dups in the second column.
Anywho Power BI kept throwing up an error and said that Bob Todd was duplicated in the first column (unique list of all the employees). I tried everything I could think of but Bob Todd wasn't a dup. Then I just did a manual slow painful process of checking to see if there were any dups at all in the first column, and there were, but it wasn't Bob Todd. The duplicate was Jenn The Horrible Manipulator (of data). Once I removed Jenn The Horrible Manipulator (of data) Power BI didn't give me an error.
Now I'm certain there is a good reason why Peanut Butter & Italianbread threw up an error but I really don't care. Once I cleaned up the data the formula worked. 100% of the time it's loser user error.
- FirasAlramli6 years agoRegular Visitor
Path = PATH('Raw Data'[Person Name],'Raw Data'[Supervisor Name])
Path required Person ID not name, and supervisior ID not Name .
This ID should be Number , eventhough type could be Text or Number