Forum Discussion
Hyuna_8000
Helper I
2 years agoHierarchical row level security Dax using Pathcontains
Hi everyone, I need to create a new role in Manage Roles to set up a row level security according to our hierarchy. I tried to use Pathcontains in the dax but still can't get the code working cor...
- 1 year ago
Thank you, the data comes as forward slash so I converted it to the Pipe symbol, the the following DAX works!
VAR EmployeeName = LOOKUPVALUE(Employee[Employee Name], Employee[Email], USERPRINCIPALNAME())
RETURN
PATHCONTAINS(Employee[Hierarchy], EmployeeName)
lbendlin
Super User
2 years agoUse the Pipe symbol, not the forward slash. Use the email address in the hierarchy, not the name.
Then all you need is
PATHCONTAINS(Employee[Hierarchy],USERPRINCIPALNAME() )
Hyuna_8000
Helper I
1 year agoThank you, the data comes as forward slash so I converted it to the Pipe symbol, the the following DAX works!
VAR EmployeeName = LOOKUPVALUE(Employee[Employee Name], Employee[Email], USERPRINCIPALNAME())
RETURN
PATHCONTAINS(Employee[Hierarchy], EmployeeName)