Forum Discussion
PATH function error
- 5 years ago
FYI that you likely need to address the distinct parent issue, but you can use the Bonus Function at the end of this article to perform the equivalent of the PATH function in your query (and it doesn't have the single parent limitation).
Guest Post: Using List.Accumulate for Input/Output Genealogy – The BIccountant
Pat
Hello jhartranft60 ,
if you use the PATH function each item must have a distinct parent. So the problem is that employee 4567 has managger 8888 and manager 7777.
Also be aware that PATH doesn't work with row level security:
"This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules."
Sorry for that, but I think this approach doesn't work.
- jhartranft605 years agoAdvocate IV
Hi selimovd
I use the hierarchy column created by the path function for the RLS. I use the PATHCONTAINS function to search the hierarchy column for the userprincipalname. I use this on many of my datasets, so I know it works well.
I guess I don't understand why my calculate function doesn't work to filter out the multiple managers. The second half of the function "Filter('Staff by Quarter','Staff by Quarter'[Quarter] = EARLIER('Staff by Quarter'[Quarter])" should filter the table down to just one Quarter and therefore eliminate the fact that there are different Manager IDs for different quarters. That's the part I'm attempting to figure out how to tweak to make this thing work.
- selimovd5 years agoMost Valuable Professional
Hey jhartranft60 ,
you get the error in the first half of the measure:
CALCULATE(PATH('Staff by Quarter'[Employee ID],'Staff by Quarter'[Manager ID])
Here the employee 4567 has manager 8888 and manager 7777. This ambiguity is not allowed, so there will be an error.
If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.biFollow me: twitter.com/DenSelimovic