Forum Discussion

Stemar_Aubert's avatar
Stemar_Aubert
Icon for Resolver I rankResolver I
6 years ago
Solved

Help with RLS, all documentation are out of date

Hi,

 

I have been looking for two days, but can not, for the life of me, find how to use RLS simply.

 

My data have 3 business units, and I want people to only see their relevant data. To this end, I have a RLS table with people's corporate emails, and their respective business unit.

 

USERBUSINESS UNIT
[email protected]BU01
[email protected]BU02
[email protected]BU03

and so on.

 

In the model, I created a relationship between the RLS and Business unit. I can filter out just fine when using a slicer on a page. It works.

 

However, I don't know how to create the DAX filter on the Manage roles menu. I have tried [RLS BUSINESS UNITS] = "BU01", but it doesn't work for the user.

 

Any help is appreciated, thanks.

  • Hi, Nevermind, I just figured out I needed to put the users in a group under the PBI service first for this to work.

     

    Thanks Anonymous

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Stemar_Aubert 

     

    So the USER column is what I assume the USERPRINCIPALNAMEs of the users. You need to create a role for your RLS data source, not the main data source. The DAX for this should be something like [USER] = USERPRINCIPALNAME()

    That way, once the user uses the dashboard, they will filter the RLS table. But this is fine, because the RLS table is connected to the main data source, so the RLS table will filter out the results in the main source to only show the relevant Business Units.

    Does this make sense?

    • Stemar_Aubert's avatar
      Stemar_Aubert
      Icon for Resolver I rankResolver I

      Hi, Nevermind, I just figured out I needed to put the users in a group under the PBI service first for this to work.

       

      Thanks Anonymous