Forum Discussion

Optimusprime_25's avatar
Optimusprime_25
Resolver I
3 years ago
Solved

Dynamic RLS based on multiple depts in multiple countries for a specific user

Hello Team,

 

I am currently stuck at implementing RLS for multiple depts in multiple countries for a specific user.

 

I have successfully implemented RLS, in filtering multiple countries for a particular user. But I am unable to filter depts in those countries for a particular user.

 

Please find below link for more details.

https://community.powerbi.com/t5/Desktop/Dynamic-RLS-based-on-multiple-conditions-in-multiple-tables/m-p/2983470#M1019354

 

Thanks in advance.

  • Hi Anonymous ,

     

    Thanks for your support.

     

    I have implemnted the dynamic RLS based on multiple countries and multiple depts for a specific user.

     

    Below are the relationships which I have implemented between multiple tables.

     

    Below is the DAX which I have implemented in the roles.

    In above DAX code, we are restricting country as well as unit of a specific user.

    From above example, we can see that emp3 is having access to USA and Canada and units ABC and XYZ.

    So he is able to see the respective data

     

    Thank you.

7 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Optimusprime_25 ,

    I have created a simple sample, please refer to it to see if it helps you.

     

    Then create relationships between the tables.

     

     

    How to Get Your Question Answered Quickly 

     

    If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

     

    Best Regards
    Community Support Team _ Polly

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

    • Optimusprime_25's avatar
      Optimusprime_25
      Resolver I

      Hi Anonymous ,

       

      Thanks for your support.

       

      I have implemnted the dynamic RLS based on multiple countries and multiple depts for a specific user.

       

      Below are the relationships which I have implemented between multiple tables.

       

      Below is the DAX which I have implemented in the roles.

      In above DAX code, we are restricting country as well as unit of a specific user.

      From above example, we can see that emp3 is having access to USA and Canada and units ABC and XYZ.

      So he is able to see the respective data

       

      Thank you.

      • AM_BSL's avatar
        AM_BSL
        Frequent Visitor

        I have same requirement but getting the below issue

        also tried this but not working 

         

        Please suggest

         

  • Hello Anonymous ,

     

    Thanks for your prompt response.

     

    I am unable to send the sample pbix file here.

     

    I will attach the snapshots of tables below.

    This is the user details table, here we cans ee that which user has which access. User should see only data for which he has access (Ex: specific country and specific unit)

     

    Below is the country table

    Below is the unit table

    Below is the main table in which the data should be restricted for a particular user.

     

     

    This is teh complete dataset, in which each particular user should see only that data which the user has been provided with the access in user details table.

     

    Main agenda of this task is to restrict the data according to the country and unit as well for any particular user.

     

    Thanks in advance.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Optimusprime_25 ,

      How about creating relationships between the tables?

      If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

       

      Best Regards
      Community Support Team _ Polly

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

      • Optimusprime_25's avatar
        Optimusprime_25
        Resolver I

        Hi Anonymous 

         

        I have changed the relationships as you mentioned unfortunately it's not working. 

        Complete dataset is visible to the users.

         

        Please find below snapshots.

         

        Could you please look provide the solution

         

        Thanks in advance.