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
zanottiluca
Helper II
Helper II

RLS Not Working

Hi guys, 

 

I am setting up a Dynamic Row Level Security on the Employee table and having a simple model . The table Employees contains userprincipalname and is linked 1->M with the table History via ID. 

Unfortunately I am retrieving the following error: once i check the "Apply Security Filter in both Direction".

The error is: "Table Employees is configured for row level security, introducing constraint on how security filters are applied". Attached image. 

 

Do you know why? I though that checkbox was a minimal reuqirement for this to work. 
Thanks

Luca

 

capture issue.PNGDRLS.PNG

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@zanottiluca Pretty sure you do not want Both. You want the relationship direction to be defined as:

 

Employees 1 -> * History

 

Thus, security enforced on Employees limits the rows and this then flows to the History table via the relationship.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
Greg_Deckler
Super User
Super User

@zanottiluca Pretty sure you do not want Both. You want the relationship direction to be defined as:

 

Employees 1 -> * History

 

Thus, security enforced on Employees limits the rows and this then flows to the History table via the relationship.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks a lot @Greg_Deckler for this, this is now working, hence my error was mainly on assuming the  "Apply security filter on both direction" was ticked. I mistakenly thought was a minimum requirement for DRLS to work!
Back to basis this tick and the Both direction, are needed only in case I have a bridge table inbetween employees and history which otherwise will not propagate the filter acordingly, correct?  
Many thanks for this.

Luca

@zanottiluca - Right, the Both direction is if you would want History to filter Employees as well as Employees to filter History. To understand this, think of this scenario.

 

Place the "Employee" column from the Employees table in a table visual. Place a column from History in the same visual. Make the aggregation "count". You will get a count of the rows in the History table for each Employee. 

 

Now, create a table visual with the "Employee" column from the History table in a table visual. Place a column from Employees table in the same visual. Make the aggregation "count". You will get a count of ALL the rows in the Employee table for each Employee.

 

This happens because Employees table filters History but not vice versa.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Thanks @Greg , this indeed anwsers also to my DLRS question. 
DLRS Apply security Filter in both Directions.PNG
Cheers
Luca

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.