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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
zaidmasad
Helper III
Helper III

Applying Row level security based on users country in dashboards

Hello,

 

I have two tables, one contains each country and its revenues, the other contains the managers and their countries as below:Capture.JPG

 

In the manager field there is the Email of each manager.

 

Anyone can advise how can I apply the Row level security in such case?

 

Below is how the table looks like

 

Managers table:

Capture.JPG

 

Data table:

Capture.JPG

 

Thanks,

Zaid

 

11 REPLIES 11
Anonymous
Not applicable

HI @zaidmasad,

 

I'd like to suggest you modify the 'cross filter direction' option to 'both' and active the 'Apply security filter in both directions' option.

11.PNG

 

Regards,

Xiaoxin Sheng

hi @Anonymous @M_Matuszewski

 

The relationship is not working, I received the below message:Capture.JPG

 

The country is not a unique value in both sheets.

 

Appreciate your help.

 

Thanks,

 

 

 

 

 

@Anonymous @M_Matuszewski

 

Its working fine now. But I still have one more question regarding the row level security, Do I still have to put in the role the users who belong to that group as below?

 

Capture.JPG.

 

isnt the excel sheet that contains the name of each user and his country enough?

 

Thanks,

Zaid

Anonymous
Not applicable

HI @zaidmasad,

 

>>isnt the excel sheet that contains the name of each user and his country enough?

Yes, you still need to save all users as the dynamic role to enable the security effect.

 

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Hi @zaidmasad,

 

You only need to create one user with dynamic RLS who based on username function, the apply this role to members.

RLS with UserName()

 

Regards,

Xiaoxin Sheng

M_Matuszewski
Frequent Visitor

use the USERNAME() function in the Row Level Security settings. Mange roles -> create a new role -> select a table with usernames -> Table filter DAX expression , Manager = USERNAME()

Hello @M_Matuszewski

 

I have tried this, but when I test as role, I dont see any data in the dashboard.

sure, it won't work while testing, because having a role defined like: [Email] = USERNAME() it will check the actual logged user. Try to manipulate your dataset, add a test email adress as a manager (to which you have access to), publish the report to the Power BI Online Service, and then log in with that test user 😉

do you use bidirectional relationship? if not - use CROSSFILTER function for the measure

@M_Matuszewski 

 

I am not sure what this relation is, but I think I am not using it. I just use the below one:

 

Capture.JPG

zaidmasad
Helper III
Helper III

Hello @jirineoral,

 

I have read your article about the low security level, but I couldnt apply it in my case. Can you please help me?

 

Thanks,

Zaid

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors