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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Girija0203
Frequent Visitor

RLS implementation on PowerBI Desktop (sources are Datamart and Excel)

We are connecting PBI desktop with 2 sources , Tractional tables from Datamart and Security table from other like (Sql,Excel). we have joins between the tables (Security filters Student). Implemented RLS on top of Security at Report level. it is not working as expected.

 

For Example- Security table having Extracurricular activities and Datamart source Student having Extracurricular activities, we build relationships between these 2. having RLS DAX on User email =UserPrincipalName(), Data is not filterin in visual having only student information

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @Girija0203 

If you use the datamart import connection mode to apply RLS normally, this is what RLS can support:

vjianpengmsft_1-1729755213458.png

Here are the results

vjianpengmsft_0-1729755174623.png

But judging from the screenshot of your relationship, you are using Direct query mode, which forms a composite mode with your Excel sheet in Import mode:

 

vjianpengmsft_2-1729755448962.png

In composite mode, RLS does not take effect, as mentioned in the documentation:

Use composite models in Power BI Desktop - Power BI | Microsoft Learn

vjianpengmsft_3-1729755661694.png

vjianpengmsft_4-1729755689811.png

In this case, you have two options:
1. Set up RLS in datamart.For this part, you can refer to the document below

Control access to datamarts (preview) - Power BI | Microsoft Learn

vjianpengmsft_5-1729755846916.png

 

2. Connect to your datamart using import mode in Power BI desktop

 

 

 

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Your ideas is so great 123abc 

Hi, @Girija0203 

Based on your description, I've created the following two tables and demonstrated the process of creating a proper RLS with them:

vjianpengmsft_0-1729747193109.png

vjianpengmsft_1-1729747200360.png

 

The relationship between them is as follows:

vjianpengmsft_2-1729747234775.png

Create an RLS for table1:

vjianpengmsft_3-1729747263643.png

Test if RLS takes effect in Power BI desktop:

vjianpengmsft_4-1729747352329.png

vjianpengmsft_5-1729747434539.png

Check whether the view takes effect:

vjianpengmsft_6-1729747445891.png

Apply this RLS for your email in the Power BI service:

vjianpengmsft_7-1729747753041.png

vjianpengmsft_8-1729747792213.png

I've uploaded the PBIX file for this test below.

 

 

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

Model is half from datamart and half from import, RLS is not filtering data

in above example StudentData from Datamart and Security from Import mode in PBI desktop 
joins are like below

Girija0203_0-1729752238815.png

And RLS has been

Girija0203_1-1729752282506.png

When view as

Girija0203_2-1729752402699.png

RLS is not effecting on 

 

Regards,

Girija 

Anonymous
Not applicable

Hi, @Girija0203 

If you use the datamart import connection mode to apply RLS normally, this is what RLS can support:

vjianpengmsft_1-1729755213458.png

Here are the results

vjianpengmsft_0-1729755174623.png

But judging from the screenshot of your relationship, you are using Direct query mode, which forms a composite mode with your Excel sheet in Import mode:

 

vjianpengmsft_2-1729755448962.png

In composite mode, RLS does not take effect, as mentioned in the documentation:

Use composite models in Power BI Desktop - Power BI | Microsoft Learn

vjianpengmsft_3-1729755661694.png

vjianpengmsft_4-1729755689811.png

In this case, you have two options:
1. Set up RLS in datamart.For this part, you can refer to the document below

Control access to datamarts (preview) - Power BI | Microsoft Learn

vjianpengmsft_5-1729755846916.png

 

2. Connect to your datamart using import mode in Power BI desktop

 

 

 

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

123abc
Community Champion
Community Champion

Following links will help you:

 

https://learn.microsoft.com/en-us/training/modules/row-level-security-power-bi/

 

https://www.youtube.com/watch?v=ZJzCkxv5wxg

 

https://www.youtube.com/watch?v=fh8HpSNNP30

 

How to Set up Row Level Security in Power BI - Zebra BI

 

Power BI and Excel; More than just an Integration - RADACAD

 

AND

 

 Here are a few steps and considerations that might help resolve the issue:

  1. Check Relationships: Ensure that the relationships between your tables are correctly defined. The relationship between the Security table and the Student table should be properly set up to allow filtering.

  2. RLS DAX Expression: Verify that your DAX expression for RLS is correctly implemented. The expression UserPrincipalName() should match the email format in your Security table. For example:

    [UserEmail] = USERPRINCIPALNAME()
  3. Role Assignment: Make sure that the roles are correctly assigned to the users in Power BI Service. After defining the roles in Power BI Desktop, you need to publish the report to Power BI Service and assign the roles to the respective users.

  4. Testing RLS: Use the “View as” feature in Power BI Desktop to test the RLS roles. This allows you to see the report as a specific user and verify if the data is being filtered correctly.

  5. Data Refresh: Ensure that the data is refreshed and up-to-date in both the Datamart and Excel sources. Sometimes, outdated data can cause issues with RLS.

  6. Security Table Configuration: Double-check the configuration of your Security table. Ensure that it contains the correct user emails and the corresponding extracurricular activities.

  7. Power BI Service Settings: In Power BI Service, ensure that the dataset settings are configured to apply RLS. Sometimes, RLS might not work as expected if the settings are not correctly configured.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors