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
URGO_Kniest
Frequent Visitor

Problem with PowerBI (RLS) with Direct Query

Hello PBI Community,

I have a question regarding using RLS in combination with DirectQuery connections.

I have the following situation in my data model:

URGO_Kniest_0-1665661372873.png

 

 

With this relation, I’m able to filter the “Sales Markets Ih” table in the report.

Now I create a new role (RLS) with the DAX query:

 

[DEPARTMENT] = USERPRINCIPALNAME()

 

and upload the report, but the report will not be filtered by the users via the RLS query:

URGO_Kniest_1-1665661372875.png

 



Can you help me with this?

 

Kind regards

 

Nico

7 REPLIES 7
URGO_Kniest
Frequent Visitor

I tested that too. Unfortunately with the same result 😞

Ok. Can you keep the RLS on email and then check whether the 'Apply security filter in both directions' is checked?

 

You can find this setting in the relationship between the 2 tables:

Smalfly_0-1665669401180.png

 

URGO_Kniest_0-1665669769582.png

Unfortunately, the option is not available for this relationship.

It should be available when there is RLS on stdc_user. But if it is not, I think you found the answer to the question why RLS is not working.

 

Can you share a pbix file (with dummy data if you want) so that I can have a look?

Smalfly
Responsive Resident
Responsive Resident

Hi there,

 

userprincipalname() fetches the Power BI login of the report user and then compares it to the value of the department column. Is it correct that the column 'department' contains the email/login of your endusers?

Hi, 
Thank you for your answer.

That's correct, the field contains the email addresses and the territory (link to "sales markets ih") in another field.

I do see from your printscreen that the table contains the 2 fields email and department.

Smalfly_0-1665669091577.png

 

Can you try to put your RLS on email instead of on Department and then try again?

So: [EMAIL] = USERPRINCIPALNAME()

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

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.