Forum Discussion
Anonymous
2 years agoNot applicable
Row Level Security DAX Expression not working with USERPRINCIPALNAME()
I'm trying to implement a row level security using the below code but it doesn't work as intended. However, when I replaced USERPRINCIPALNAME() with the actual email address, the RLS filter works. I...
- 2 years ago
Try this DAX
[dept] = MAXX( FILTER( email_mapping, CONTAINSSTRINGEXACT(TRIM(email_mapping[Permissions]), TRIM(USERPRINCIPALNAME())) ), email_mapping[Dept] )
Joe_Barry
2 years agoSolution Sage
Hi Anonymous
If the Department column has a relationship with the Fact Table Department, then try this.
CONTAINSSTRING(email_mapping[Permissions], USERPRINCIPALNAME())
Joe
- Anonymous2 years agoNot applicable
Thanks for the reply. Yes the Department column has a relationship with the Fact Table Department. The DAX Expression you have provided seems no different to mine?
- Joe_Barry2 years agoSolution Sage
It is that in that there is no need to define the Department if you have a relationship between both tables.
I am presuming that you are using the Modeling > Manage Roles feature?