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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
v-shex-msft
Community Support
Community Support

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

hi @v-shex-msft @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,

 

 

 

 

 

@v-shex-msft @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

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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