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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
niklanzo91
Regular Visitor

RLS for SSAS on Prem not Working

Hi All,

I'm working with a Power Bi connected in direct Query with a SSAS on prem. The report is published in Power BI Service.

They asked me to test some basic RLS rules based on the email of some users to restrict the access to data (some users can only see the data of certain branches).

 

In the Tabular Model I created a table that contains a row for the branchID, and a row for the user (using the email).

 

I created the Role, added some colleagues to the Membership for testing purpose, and write a DAX formula =

 

xxxxx.[CompanyID] = LOOKUPVALUE(yyyy[CompanyID], yyyy[User], USERPRINCIPALNAME))

 

We deployed the model but the colleagues still see everything.

We also tried to use a static RLS directly on the target table giving punctual values, but the RLS is still not working.

 

It could be a problem of Active Directory? Not matching the 365 account with the local AD account? Also on Power BI Desktop they still se everything.

 

Thanks in Advance

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @niklanzo91 

I created your tables and used them in SSMS, the data in RLStable is a test mailbox:

vyohuamsft_0-1733130905282.png

vyohuamsft_1-1733130944303.png

 

In Power BI Desktop, tap the Modeling tab, and then select Manage roles. Create a new role, such as BranchRole. Add the following DAX formula to your BranchTable:

[CompanyID] = LOOKUPVALUE(RLSTable[CompanyID], RLSTable[UserEmail], USERPRINCIPALNAME())

vyohuamsft_2-1733131272475.png

 

Publish to the Power BI service to configure RLS in the Power BI service. In the Power BI service, open the published report and tap Settings. In the Security tab, select the role that you created, BranchRole. Add the users or groups you want to test.

vyohuamsft_3-1733131379752.png

vyohuamsft_4-1733131611156.png

The creator's perspective is to be able to see all the data.

vyohuamsft_6-1733131826174.png

 

I have another user in my workspace. Until I added it as an RLS role, he couldn't see the data for my reports.

vyohuamsft_7-1733131864185.png

 

When I add it to the RLS role, he will only see the data that corresponds to his email address

vyohuamsft_8-1733131937673.png

vyohuamsft_10-1733132009487.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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

3 REPLIES 3
NandanHegde
Super User
Super User

Plz share some sample data across the tables for us to identify the cause?

Can you confirm whether the user details are in the same format as the USERPRINCIPALNAME.

 

As it is connect live to SSAS, you can directly test the RLS within SSAS




----------------------------------------------------------------------------------------------
Nandan Hegde (MSFT Data MVP)
LinkedIn Profile : www.linkedin.com/in/nandan-hegde-4a195a66
GitHUB Profile : https://github.com/NandanHegde15
Twitter Profile : @nandan_hegde15
MSFT MVP Profile : https://mvp.microsoft.com/en-US/MVP/profile/8977819f-95fb-ed11-8f6d-000d3a560942
Topmate : https://topmate.io/nandan_hegde
Blog :https://datasharkx.wordpress.com

Hi NandanHedge,

thanks for your reply.

 

I can confirm that the user email is the same of the result of USERPRINCIPALNAME (I tested it with a colleague).

Where can I test them within SSAS? With MDX Queries?

 

I leave here an example of the structure. I don't filter directly the fact table, but a dimension table related with the fact table.

 

This is the dimension table (branch_table):

CompanyIdDescription
01UK
02US
03DE

and this is the RLS_table. One user can see more than one branch:

 

CompanyIdUser
01user1@example.com
02user1@example.com
03user2@example.com
Anonymous
Not applicable

Hi, @niklanzo91 

I created your tables and used them in SSMS, the data in RLStable is a test mailbox:

vyohuamsft_0-1733130905282.png

vyohuamsft_1-1733130944303.png

 

In Power BI Desktop, tap the Modeling tab, and then select Manage roles. Create a new role, such as BranchRole. Add the following DAX formula to your BranchTable:

[CompanyID] = LOOKUPVALUE(RLSTable[CompanyID], RLSTable[UserEmail], USERPRINCIPALNAME())

vyohuamsft_2-1733131272475.png

 

Publish to the Power BI service to configure RLS in the Power BI service. In the Power BI service, open the published report and tap Settings. In the Security tab, select the role that you created, BranchRole. Add the users or groups you want to test.

vyohuamsft_3-1733131379752.png

vyohuamsft_4-1733131611156.png

The creator's perspective is to be able to see all the data.

vyohuamsft_6-1733131826174.png

 

I have another user in my workspace. Until I added it as an RLS role, he couldn't see the data for my reports.

vyohuamsft_7-1733131864185.png

 

When I add it to the RLS role, he will only see the data that corresponds to his email address

vyohuamsft_8-1733131937673.png

vyohuamsft_10-1733132009487.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.