Quantcast
Channel: Service topics
Viewing all articles
Browse latest Browse all 61622

Dynamic row Level Security not working

$
0
0

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?


Viewing all articles
Browse latest Browse all 61622

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>