cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
luxpbi Member
Member

Problems with RLS

Hi all, 

 

I'm having troubles setting RLS to one of my reports. 

 

I have a fact sales table such as: 

 

Office …(other columns, not relevant)
1
1
1
2
2
3
4
4

 

Dimension tables: 
Office: 

(One row per office code)

Office Code Office Name
1A
2B
3C
4D

Users: 

(Determines the offices that the users should see, can have multiple offices codes for one user)

UsersUsers emailOffice Name
AA...@...1
AA...@...2
AA...@...3
AA...@...4
AB...@...2
AB...@...3
AB...@...4
AC...@...4
AD...@...2


I have a bidirectional filter set between Users and Office and a Single direction filter between Office and my facts table. 

 

Then I have the next Role in the table Users:

[Users email] = USERNAME() 

 

Any ideas why this doesn't work? Or how should I do it?

Thank you a lot ofr your help.

 

Regards,

3 REPLIES 3
Super User
Super User

Re: Problems with RLS

 Hello @luxpbi

You have many to many relationship between offices and users. 

 

You can build the below model:

 

Model.PNG

 

 Model2.PNG

 

and then use this RLS rule:

 

Capture.PNG

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!  

luxpbi Member
Member

Re: Problems with RLS

Hi @LivioLanzo

 

It's a very good idea the Users email table. But it is not working. 

 

I'm testing it in my workspace, can this be a issue? 

 

It's going to be hard for me to test it with others users... 

 

Regards,

Super User
Super User

Re: Problems with RLS

@luxpbi

 

I'd first test it within Power BI Desktop to see how it works and you can test it for different email addresses 

 


 


Did I answer your question correctly? Mark my answer as a solution!


Proud to be a Datanaut!