Forum Discussion
Ritesh_Air
Post Patron
6 years agoRow Level Security - Filter Region
Hi, I have applied RLS to my model which works correctly. Users see their own data. But it gets little complicated when users are in different regions. For e.g. User Region Sales 100 ...
- 6 years ago
Hi Ritesh_Air ,
Try this:
1. Tables:
2. Create relationships.
3. Manage roles.
For Sales table,
[Region] IN SELECTCOLUMNS ( FILTER ( 'Region', RELATED ( 'User'[UserEmail] ) = USERPRINCIPALNAME () ), "Region", [Region] )For User table.
[UserEmail] = USERPRINCIPALNAME()Then, test.
BTW, .pbix file attached.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Icey
Community Support
6 years agoHi Ritesh_Air ,
Try this:
1. Tables:
2. Create relationships.
3. Manage roles.
For Sales table,
[Region] IN SELECTCOLUMNS (
FILTER ( 'Region', RELATED ( 'User'[UserEmail] ) = USERPRINCIPALNAME () ),
"Region", [Region]
)
For User table.
[UserEmail] = USERPRINCIPALNAME()
Then, test.
BTW, .pbix file attached.
Best Regards,
Icey
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.