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
vin26
Resolver I
Resolver I

Dynamic RLS with All Country Access

Hello,

 

I need to create a dynamic role with country-level and all-country access (Admin Level). Please see the data format below. Please let me know if there is a quick solution.

 

User Table:

Screenshot 2025-04-05 000107.png

 

Counry Table:

Screenshot 2025-04-05 000148.png

1 ACCEPTED SOLUTION

Hi @vin26 

To define a single RLS role that includes both dynamic and static logic. Consider the following steps:

1. Admin users to see all data.

2. Regular users to see only the countries assigned to them in the mapping table.

 

DAX

 

OR (

LOOKUPVALUE('UserAccessTable'[Role], 'UserAccessTable'[email_ID], USERPRINCIPALNAME()) = "Admin",

 

[Country] IN

SELECTCOLUMNS(

FILTER(

'UserAccessTable',

'UserAccessTable'[email_ID] = USERPRINCIPALNAME()

),

"Country", 'UserAccessTable'[Country]

)

)

 

This approach ensures everything is handled in one role, which works perfectly in Power BI Service.

If this post helps, kindly mark it as Accepted Solution.

Thank You.

View solution in original post

5 REPLIES 5
v-karpurapud
Community Support
Community Support

Hi @vin26 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

Thank you.

vin26
Resolver I
Resolver I

Hi @lbendlin Thank you for the response, could you please help to write Dynamic and Static role in same RLS Role?

Hi @vin26 

To define a single RLS role that includes both dynamic and static logic. Consider the following steps:

1. Admin users to see all data.

2. Regular users to see only the countries assigned to them in the mapping table.

 

DAX

 

OR (

LOOKUPVALUE('UserAccessTable'[Role], 'UserAccessTable'[email_ID], USERPRINCIPALNAME()) = "Admin",

 

[Country] IN

SELECTCOLUMNS(

FILTER(

'UserAccessTable',

'UserAccessTable'[email_ID] = USERPRINCIPALNAME()

),

"Country", 'UserAccessTable'[Country]

)

)

 

This approach ensures everything is handled in one role, which works perfectly in Power BI Service.

If this post helps, kindly mark it as Accepted Solution.

Thank You.

v-karpurapud
Community Support
Community Support

Hi @vin26 

We would like to confirm that the solution provided by @lbendlin  is accurate and resolves the issue. Could you please confirm if your query has been resolved? If it has, kindly mark the helpful response and accept it as the solution. This will help other community members resolve similar issues more efficiently. If not, please provide detailed information so we can assist you better.

Thank you

lbendlin
Super User
Super User

For true Dynamic RLS you woud need to assign user3 to all countries individually in your mapping table.

 

But you can have a second, static role that returns true for all admin users, and that can then overrule the first role.

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.