cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
zaidmasad Member
Member

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
zaidmasad Member
Member

Re: Applying Row level security based on users country in dashboards

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

 

M_Matuszewski Frequent Visitor
Frequent Visitor

Re: Applying Row level security based on users country in dashboards

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()

zaidmasad Member
Member

Re: Applying Row level security based on users country in dashboards

Hello @M_Matuszewski

 

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

M_Matuszewski Frequent Visitor
Frequent Visitor

Re: Applying Row level security based on users country in dashboards

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

zaidmasad Member
Member

Re: Applying Row level security based on users country in dashboards

@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

M_Matuszewski Frequent Visitor
Frequent Visitor

Re: Applying Row level security based on users country in dashboards

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 ;-)

Community Support Team
Community Support Team

Re: Applying Row level security based on users country in dashboards

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 Sheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.



For learning resources/Release notes, please visit: | |
zaidmasad Member
Member

Re: Applying Row level security based on users country in dashboards

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,

 

 

 

 

 

zaidmasad Member
Member

Re: Applying Row level security based on users country in dashboards

@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