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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Mous007
Helper IV
Helper IV

Switching to dynamic RLS

Hi all, I was using static RLS in the model attached to grant access to users based on their function and it was working fine.

Each test is related to a specific function and some tests can be in more than one function as per below

Mous007_0-1613506087909.png

 

In addition to accesses based on the user function, as an additional requirement i also have to grant the same users the same access based on the function but also based on the regional or just country access.

 

For the region/country mapping, each unit is assigned to a specifc country and region but access can be either granted on a regional or country level (which makes my task even more complicated)

Mous007_1-1613506263416.png

I created roles same as i did before and granted each user access to a role based on the function filter and a second one based on the region or country but for some reason it does not work and users can view all data (functions and region)

 

My fact table is below and each unit has tests to run with the respective result.

 

Mous007_2-1613506514278.png

Mymodel sample is attached and would really appreciate if someone can show me how i can implement dynamic RLS in this case to grant accesses based on both the function and the region OR country depending on the request. any useful link for my case would also be appreciated.

 

my sample is attached here for you reference.

 

Thaank you

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @Mous007  ,

I create this data:

v-yangliu-msft_0-1613608837382.png

Here are the steps you can follow:

1. Select Manage roles in Modeling and use the userprincipalname() function

v-yangliu-msft_1-1613608837386.png

2. Select View as

v-yangliu-msft_2-1613608837387.png

3. Enter the user’s email to enter the View mode

v-yangliu-msft_3-1613608837388.png

4. Result

Only the contents of the input mailbox will be displayed in the table:

v-yangliu-msft_4-1613608837390.png

You can downloaded PBIX file from here.

 

For information about dynamic RLS, you can check the following link:

https://radacad.com/what-do-you-need-to-implement-dynamic-row-level-security-in-power-bi

https://radacad.com/dynamic-row-level-security-with-power-bi-made-simple

https://docs.microsoft.com/en-us/power-bi/admin/service-admin-rls

 

Best Regards,

Liu Yang

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

1 REPLY 1
Anonymous
Not applicable

Hi  @Mous007  ,

I create this data:

v-yangliu-msft_0-1613608837382.png

Here are the steps you can follow:

1. Select Manage roles in Modeling and use the userprincipalname() function

v-yangliu-msft_1-1613608837386.png

2. Select View as

v-yangliu-msft_2-1613608837387.png

3. Enter the user’s email to enter the View mode

v-yangliu-msft_3-1613608837388.png

4. Result

Only the contents of the input mailbox will be displayed in the table:

v-yangliu-msft_4-1613608837390.png

You can downloaded PBIX file from here.

 

For information about dynamic RLS, you can check the following link:

https://radacad.com/what-do-you-need-to-implement-dynamic-row-level-security-in-power-bi

https://radacad.com/dynamic-row-level-security-with-power-bi-made-simple

https://docs.microsoft.com/en-us/power-bi/admin/service-admin-rls

 

Best Regards,

Liu Yang

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

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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