Forum Discussion
Anonymous
3 years agoNot applicable
How do i create a RLS role for 2 scenarios
I have a cost code column and a Email ID column. User should get the access of cost code against the email ID and in case of * against the email id user to should have access to all the cost code. ...
- 3 years ago
Anonymous , refer if this can help
Power BI- Row Level Security: Handle ALL, UserPrincipalName: https://youtu.be/KVLEnIUo4pc
jdbuchanan71
3 years agoSuper User
I am assuming you are filtering another table that has data by cost code. You would apply a filter to that table by reading from the UserAccess table like this.
VAR _UPN = USERPRINCIPALNAME()
RETURN
IF (
LOOKUPVALUE (
UserAccess[Costcode],
UserAccess[Email-ID], _UPN,
UserAccess[Costcode], "*"
) = "*",
TRUE,
'Table'[CostCode]
= LOOKUPVALUE (
UserAccess[Costcode],
UserAccess[Email-ID], _UPN,
UserAccess[Costcode], 'Table'[CostCode]
)
)
I have attached my sample file for you to look at. You can test the RLS by using View As on the modeling ribon
You can see that bgy can see all rows:
but bcd can only see the subset he is assigned to