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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
CharanIndukuri
Frequent Visitor

dymanic RLS

If we use userprincipalname() we can map or restrict countries access, My question is how can we remove access for 100 people out of 1000 people in a table? 

1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi  @CharanIndukuri- you can create a table that maps users (UserPrincipalName()) to the countries or data they are allowed to access. Include a flag or a condition to identify the users who should have no access. 

create RLS Table as like below:

 

create a RLS security table as below:

rajendraongole1_2-1732557749174.png

 

Users with Access = 0 are restricted from accessing any data.

 

you can define the role in modelling as like below:

[UserEmail] = USERPRINCIPALNAME() && [Access] = 1

 

 

rajendraongole1_1-1732557681006.png

 

In Power BI Desktop:
Go to the Modeling tab → Manage Roles.
Create a new role and apply the DAX rule above to the security table.
Publish the report to Power BI Service.
Assign users or groups to the RLS role in Power BI Service.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

1 REPLY 1
rajendraongole1
Super User
Super User

Hi  @CharanIndukuri- you can create a table that maps users (UserPrincipalName()) to the countries or data they are allowed to access. Include a flag or a condition to identify the users who should have no access. 

create RLS Table as like below:

 

create a RLS security table as below:

rajendraongole1_2-1732557749174.png

 

Users with Access = 0 are restricted from accessing any data.

 

you can define the role in modelling as like below:

[UserEmail] = USERPRINCIPALNAME() && [Access] = 1

 

 

rajendraongole1_1-1732557681006.png

 

In Power BI Desktop:
Go to the Modeling tab → Manage Roles.
Create a new role and apply the DAX rule above to the security table.
Publish the report to Power BI Service.
Assign users or groups to the RLS role in Power BI Service.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.