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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
hi_world
Helper III
Helper III

weird behavior when using RLS in direct query mode

Hello, 

 

For the axample i have two tables : 

Relationship :  Table1 1----N Table2

 

I have one role : RLS :  [email] = USERPRINCIPALNAME()

 

I apply the role in the two tables. 

 

When i display one column from Table2 in visualization i have this sql generated : 

 

select column1 from

  (Select * from Table2 where Table2.email ='toto@toto.com' ) test

   INNER JOIN Table1 on test.key = Table1.key

   WHERE Table1.email ='toto@toto.com'

 

I dont want powerbi to do the join with Table1. 

 

I don't understand this behavior.
How to avoid it?

 

Best regards

5 REPLIES 5
v-jingzhang
Community Support
Community Support

Hi @hi_world 

 

The join operation is caused by the relationship between two tables. And you have applied the RLS rule on both tables. Since the relationship exists, usually you only need to apply the RLS rule on one table that can filter the other table via the relationship. Try removing the RLS rule on Table1 or Table2. This may give you a different result. 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Hello @v-jingzhang 

what would be your solution if you still have to apply the same role on both tables because both tables have RLS ? 

 

Best regards

Hi @hi_world 

Is it possible to remove the relationship between two tables? 

No, it is an important relationship 

Hello @v-jingzhang 

 

So you tell me that this is a normal behavior of powerbi.
the problem with this join generated by powerbi can cause a loss of information on certain rows of the tables. because of the where on the second table.
Thanks for your feedback

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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