Forum Discussion
RLS on region level
I am trying to apply RLS such that, I have an excel file with user email and region and main table containing data with region
I want to create a role such that, if one user belonging to specific user logs in should see the entire data for that region including others belonging to the same region and not only their data
Following is the role I am trying to apply on the Main Table, however there is no impact,
I want to keep the access dynamic instead of creating role for each region.
Hello Revati25
Try replacing = with IN
And Confirm that the email addresses stored in your mapping file exactly match those returned by USERPRINCIPALNAME()
Ensure that the mapping table and your MainTable have the proper relationship.
MainTable[Region] IN
CALCULATETABLE(
VALUES('Access File for Region'[Region]),
'Access File for Region'[Email] = USERPRINCIPALNAME()
)Test the role as a viewer to see the expected results.
6 Replies
- DekuSuper User
You have to remember if you are testing on the service, if you are a workspace admin, even if you are in a role it will not apply.
You can locally in power bi desktop by selecting view as from modelling tab of the ribbon. Or you can connect to the model with Dax studio and impersonate another user in the role
- nilendraFabricSuper User
Hello Revati25
Try replacing = with IN
And Confirm that the email addresses stored in your mapping file exactly match those returned by USERPRINCIPALNAME()
Ensure that the mapping table and your MainTable have the proper relationship.
MainTable[Region] IN
CALCULATETABLE(
VALUES('Access File for Region'[Region]),
'Access File for Region'[Email] = USERPRINCIPALNAME()
)Test the role as a viewer to see the expected results.
- Revati25Advocate I
Thank you for the solution.
- v-prasareCommunity Support
Hi Revati25 , As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for your issue worked? or let us know if you need any further assistance here?
nilendraFabric& Deku Thanks for your promt response.
Thanks,
Prashanth Are
MS Fabric community support
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query
- v-prasareCommunity Support
Hi @Revati25 , As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for your issue worked? or let us know if you need any further assistance here?
Thanks,
Prashanth Are
MS Fabric community support
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query
- v-prasareCommunity Support
Hi Revati25,As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for your issue worked? or let us know if you need any further assistance here?
Thanks,
Prashanth Are
MS Fabric community support
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query