Forum Discussion

ptmuldoon's avatar
ptmuldoon
Resolver I
2 years ago
Solved

Help Setting up Dynamic RLS with Multiple Conditions

I'm hoping someone can possibly help and explain the proper way to set up RLS filters with 'multiple conditions'.  I've been trying to do this following the below info from Radacad, and not use 'Appl...
  • Anonymous's avatar
    Anonymous
    2 years ago

    HI,ptmuldoon 

    Regarding the issue you raised, my solution is as follows:

    1.First I have created the following table and the column names and data are the data you have given:

    2.Next create relationships between tables:

     

     3.Then, I created two measure to make it easy for you to see the change:

    u1 = USERNAME()
    upn1 = USERPRINCIPALNAME()

    4.Then I also configured two different rls:

    5.In desktop:

    6.In service:

    7.The above results verify that username() uses the "domain \ username" format in Power BI Desktop. In the Power BI service and the Power BI Report Server, the user's User Principal Name (UPN) format is used. Alternatively, you can use userprincipalname(), which always returns a user in its userprincipalname format [email protected].

    8.Verify the rls role below:

    9.From the above, if you need to use the rls of the primary table to restrict the access permission of other tables, it is best to establish a one-to-one relationship, or establish a one-to-many relationship, otherwise rls will not take effect.

     

    10.The following documents may help you:

    Security in Power BI embedded analytics - Power BI | Microsoft Learn

    Row-level security (RLS) with Power BI - Microsoft Fabric | Microsoft Learn

     

    If you need us to know more about you, could you please re-share the link? We are temporarily unable to obtain valid data through the link you share, so that we can not conduct further analysis based on your data structure. Please take care to remove sensitive information.

     

    Best Regards,

    Leroy Lu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.