Forum Discussion

Ritesh_Air's avatar
Ritesh_Air
Post Patron
6 years ago
Solved

Row 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    ...
  • Icey's avatar
    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.