Forum Discussion
RLS for Multiple Tables
- 5 years ago
Hi, avulasandeep
According to your description, I can roughly understand your requirement, I think you can try my steps:
- Go to the “Manage Roles” to create a new role and enter the DAX formual like this:
[Dealer ID] in SELECTCOLUMNS( FILTER( 'Dealer', [Email] = UserPrincipalName()), "Dealer ID",[Dealer ID]) || [District] in SELECTCOLUMNS( FILTER( 'District', [Email] = UserPrincipalName()), "District",[District]) || [Region] in SELECTCOLUMNS( FILTER( 'Region', [Email] = UserPrincipalName()), "Region",[Region])- Then you can create a measure to display your currecnt userprincal name in the power Bi desktop:
USERPRINCIPALNAME = USERPRINCIPALNAME()- You can go the the “View as” to test the RLS using the “New role”:
- Test successful, then you can publish this report to the Power Bi service to add users to the new role to make the RLS work:
And you can get what you want.
You can download my test pbix file below
The document link I followed:
https://radacad.com/dynamic-row-level-security-in-power-bi-with-exclude-and-include-rules
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, avulasandeep
According to your description, I can roughly understand your requirement, I think you can try my steps:
- Go to the “Manage Roles” to create a new role and enter the DAX formual like this:
[Dealer ID] in
SELECTCOLUMNS(
FILTER(
'Dealer',
[Email] = UserPrincipalName()),
"Dealer ID",[Dealer ID])
||
[District] in
SELECTCOLUMNS(
FILTER(
'District',
[Email] = UserPrincipalName()),
"District",[District])
||
[Region] in
SELECTCOLUMNS(
FILTER(
'Region',
[Email] = UserPrincipalName()),
"Region",[Region])
- Then you can create a measure to display your currecnt userprincal name in the power Bi desktop:
USERPRINCIPALNAME = USERPRINCIPALNAME()
- You can go the the “View as” to test the RLS using the “New role”:
- Test successful, then you can publish this report to the Power Bi service to add users to the new role to make the RLS work:
And you can get what you want.
You can download my test pbix file below
The document link I followed:
https://radacad.com/dynamic-row-level-security-in-power-bi-with-exclude-and-include-rules
Thank you very much!
Best Regards,
Community Support Team _Robert Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.