Forum Discussion

avulasandeep's avatar
avulasandeep
Helper III
5 years ago
Solved

RLS for Multiple Tables

Hi All,

Need Help regarding RLS for MUltiple Tables .

Here is  the question Mentioned in the Link .
IF you click on the link you can find the screenshot and Excel what i am asking  for ..
RLS for Multiple Tables 
Click Here for RLS FIles 

I have 4 Tables in that i have Table1, Region , District  and Dealer Tables . Here i have Mentioned  RLS for the all the Tables in the screenshot . PLease open the link and You can see what exactly i am asking for . I Need RLS for Multiple Tables USers / mail id.

Thanks in Advance 
Sandeep


  • Hi, avulasandeep 

    According to your description, I can roughly understand your requirement, I think you can try my steps:

    1. 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])
    1. Then you can create a measure to display your currecnt userprincal name in the power Bi desktop:
    USERPRINCIPALNAME = USERPRINCIPALNAME()
    1. You can go the the “View as” to test the RLS using the “New role”:

     

    1. 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.

1 Reply

  • v-robertq-msft's avatar
    v-robertq-msft
    Community Support

    Hi, avulasandeep 

    According to your description, I can roughly understand your requirement, I think you can try my steps:

    1. 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])
    1. Then you can create a measure to display your currecnt userprincal name in the power Bi desktop:
    USERPRINCIPALNAME = USERPRINCIPALNAME()
    1. You can go the the “View as” to test the RLS using the “New role”:

     

    1. 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.