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

Dynamic row Level Security not working

Im using Adventureworks and in Power BI I have given a three employees our email addresses for the test

I have added an IsManager Conditional Column and made someone Manager.

Im the App Workspace Admin

 

Then in Manage roles I have created the following expression

 

IF(
MAXX(
Filter(
'DimEmployee',
'DimEmployee'[EmailAddress]=USERPRINCIPALNAME())
,'DimEmployee'[isManager]
)=0,
'DimEmployee'[EmailAddress]= USERPRINCIPALNAME(),
1=1
)

 

Find the Max in is Manager (Which is a 1. Everything else is zero) and if its not the manager then only display records for the User principal

 

If its 1, show everything. I think I got this from an example.

 

I then go into Service after a Publish and go to Test the row level secutity. I put myself and the other test user in and we can see all the records

I put in the email of the manager and no rows appear.

the DAX seems fine to me but the tests are coming back with completly the wrong results. All records when there should be just records against the person. And No records when they should be seeing everything

 

What have I dont wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Memorable Member
Memorable Member

Re: Dynamic row Level Security not working

Yes I did.

 

Ive tried this again on a brand new very basic report in a new App workspace and it worked.

 

I have done exactly the same process. 

View solution in original post

8 REPLIES 8
Highlighted
Super User IV
Super User IV

Re: Dynamic row Level Security not working

Hi there

I would suggest following this blog post by Reza Rad, which explains exactly what you are trying to achieve.

https://radacad.com/dynamic-row-level-security-with-manager-level-access-in-power-bi




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Highlighted
Memorable Member
Memorable Member

Re: Dynamic row Level Security not working

Thats absolutely the one I have used. I have read it so many times and mine still doesnt work

 

I think this is the thirs time I have attempted to do it from scratch using this blog. Are there any other blogs that I can follow for the same logic.

 

Basically the users who should only see their own information see all the info

And the user who should see everything sees nothing with this logic

 

 

Highlighted
Community Support
Community Support

Re: Dynamic row Level Security not working

HI @DebbieE,

In fact, all records displayed not means your RLS works, it also appeared if users have edit permissions of your report.
Please double-check these user permission to confirm they only have read permission or RLS filter effect it works on these users.

Row-level security (RLS) with Power BI#using-rls-with-workspaces-in-power-bi 

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Memorable Member
Memorable Member

Re: Dynamic row Level Security not working

User 1 is Admin so seeing all records is OK

User 2 and User 3 havent been added to the app workspace. they have been added to the app

 

And with this logic the issue still stands.

User 2 sees all rows. User 3 sees nothing. 

 

I just cannot get dynamic security working. 

 

Instead of testing in Security (test as role) I got user 2 to go into the App and they cant see anything even though they should be able to see their information

 

I really dont know how to move forward with this one?

Highlighted
Super User IV
Super User IV

Re: Dynamic row Level Security not working

Hi there

Just to confirm you did add the users in the Security Section for your dataset?

 

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Highlighted
Advocate II
Advocate II

Re: Dynamic row Level Security not working

I believe @GilbertQ's latest comment is the key to your issues with dynamic RLS.

 

if the emails have not been added to the security section of the dataset in the Power BI Service you'll experience the issues you've outlined in this thread.

Highlighted
Memorable Member
Memorable Member

Re: Dynamic row Level Security not working

Yes I did.

 

Ive tried this again on a brand new very basic report in a new App workspace and it worked.

 

I have done exactly the same process. 

View solution in original post

Highlighted
Advocate II
Advocate II

Re: Dynamic row Level Security not working

Interesting! 


Well, I'm glad you were able to get it up and running on another report, if you'd still like to figure out the initial report, I'd be happy to look over the pbix file.

 

Have a great Friday!

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Upcoming Events

Upcoming Events

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

We are thrilled to announce we will begin running a monthly webinar series named Power BI Dev Camp.

Top Solution Authors
Top Kudoed Authors