Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
luxpbi
Helper V
Helper V

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
LivioLanzo
Solution Sage
Solution Sage

 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!  

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,

@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!  

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors