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

row level security - Based on User logged in, show all the records belonging to his/her region(Geo)

 

Hi All,

 

I am trying to establish some speicifc RLS like below:

Based on the User logged in (who opens the Report Server URL), I need to filter the visuals to show all the records of Region that user belongs to.

 

Example, in my below screen shots, I have two table visuals built on Adventure Workd DW - Dim Customer, Dim Geograpy and FactInternetSales.

Now when a user (Aaron Kumar, second in the screen shot) opens this report, he should be able to see all the records belonging to Regoin = United States. If user (Aaron King, first in the screen shot) opens this report, he should be able to see all the records belonging to Region = Canada.

 

I have tried to add a Role like shown below, two rules for one role. But really dont understand how to achieve this.

AdvWorks1.JPGAdvWorks2.JPGAdvWorks3.JPG

 

Any one can suggest how to acheive this?

 

Thanks

Manoj

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: row level security - Based on User logged in, show all the records belonging to his/her region(G

HI, @manalla 

You could try the expression like this

[Region] in CALCULATETABLE(VALUES(Dim[Region]),FILTER(Dim,Dim[Name]=USERNAME()))

and in your report, adjust as below:

[Region] in CALCULATETABLE(VALUES(Dim[Region]),FILTER(Dim,Dim[EmailAddress]=USERNAME()))

 

3.JPG

 

Result:

For example:

5.JPG6.JPG

 

and here is my pbix file, please try it.

 

 

Best Regards,

Lin

Community Support Team _ Lin
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
Community Support Team
Community Support Team

Re: row level security - Based on User logged in, show all the records belonging to his/her region(G

HI, @manalla 

You could try the expression like this

[Region] in CALCULATETABLE(VALUES(Dim[Region]),FILTER(Dim,Dim[Name]=USERNAME()))

and in your report, adjust as below:

[Region] in CALCULATETABLE(VALUES(Dim[Region]),FILTER(Dim,Dim[EmailAddress]=USERNAME()))

 

3.JPG

 

Result:

For example:

5.JPG6.JPG

 

and here is my pbix file, please try it.

 

 

Best Regards,

Lin

Community Support Team _ Lin
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

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors