Forum Discussion
Row Level Security Question
- 5 years ago
Hi JohnLow
Could you try applying a security filter
I tried at my end and it works
For Finance user - everything is visible and for network user - only data related to him
In case you don't want to use 2 roles
you can use the following DAX for the user table
If(MaxX(
Filter(
Users,
Users[Username] = Username())
,Users[Role])= "Network user",
Users[Username] = Username(),
1=1
)
- JohnLow5 years ago
Helper I
sayaliredij Thanks. I have a similar DAX statement for my network role in the pbix file above. This works ok. I'm just wondering do I need another role. Could you have a look at the pbix file attached please?
[NetworkID] IN SELECTCOLUMNS ( FILTER ( Network, Network[UserId] = LOOKUPVALUE ( Users[UserID], Users[UserName], USERPRINCIPALNAME() ) ), "NetworkID", [NetworkID] )- JohnLow5 years ago
Helper I
Ideally what I would like is one role. I would create a new column in the Users table with an override flag.
OverRideFlag = IF( ISERROR( SEARCH("Network", Users[Role]) ), "Y", "N" )The DAX would then say, if User is a network user(override flag = no) follow the DAX in message 4 above, if not (override flag = yes) access everything in the Sales table. I could then add the everyone group to the powerbi online service and then it would filter automatically? The only manual work I would have to do is to share the report.
Would be great if you could help me with the DAX, thanks again.
- sayaliredij5 years ago
Solution Sage
I think one role with DAX above should be sufficient. I checked pbix file attached and tried with only one role and viewing it as different username as mentioned in the Users Table and I was getting expected result
- JohnLow5 years ago
Helper I
sayaliredij, I'm not sure. If I add for example, Leah, a non network user to the network group online, she doesn't see everything. She should see everything.
If I test with Leah, a non network user, she doesn't see anything in the table: