Forum Discussion
Hyuna_8000
1 year agoHelper I
Hierarchical 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
1 year agoSuper User
Use 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
1 year agoHelper I
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)