Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I have a question regarding to Row Level Security.
I have successfully set up a RSL by using a bridge table and a relationship.
But some individuals have access to ALL data, how can I add this to my RLS Dax measure?
So now I have :
[Mail] = USERPRINCIPALNAME()
The bridgetable contains Mail & Unit.
When the username has "All" as Unit, it shouldnt filter
When it has something else, it should filter on Unit.
Any help?
Robbe
Solved! Go to Solution.
Hi @RobbeVL ,
You can try to use the following DAX to filter RLS.
VAR t = FILTER ( User, [Mail] = USERPRINCIPALNAME () ) VAR u = [Unit] RETURN IF ( CONTAINS ( t, [Unit], "ALL" ), TRUE (), CONTAINS ( t, [Unit], u ) )
BTW, pbix as attached.
Best regards,
Community Support Team _ DongLi
If this post helps, then please consider Accept it as the solution to help the other members find it more
Hi @RobbeVL ,
You can try to use the following DAX to filter RLS, but remember that people who have edit permission will always see the all data regardless of the filter.
VAR u = LOOKUPVALUE ( 'User'[Unit], 'User'[Mail], USERPRINCIPALNAME () ) RETURN IF ( u = "ALL", TRUE (), [Unit] = u )
BTW, pbix as attached.
Best regards,
Community Support Team _ DongLi
If this post helps, then please consider Accept it as the solution to help the other members find it more
Hi,
This almost works, What I might nog have mentioned is the following:
Some users are allowed to see multiple units. So my data looks like:
'AccessList'
Unit1 --- Angela@xx.com
Unit2 --- Angela@xx.com
'BU_List'
Unit 1
Unit 2
Unit 3
LOOKUPVALUE can only return 1 value, so it gives me an error when I view as a person who can see multiple Units.
Any workaround?
Robbe
Hi @RobbeVL ,
You can try to use the following DAX to filter RLS.
VAR t = FILTER ( User, [Mail] = USERPRINCIPALNAME () ) VAR u = [Unit] RETURN IF ( CONTAINS ( t, [Unit], "ALL" ), TRUE (), CONTAINS ( t, [Unit], u ) )
BTW, pbix as attached.
Best regards,
Community Support Team _ DongLi
If this post helps, then please consider Accept it as the solution to help the other members find it more
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
115 | |
100 | |
88 | |
68 | |
61 |
User | Count |
---|---|
152 | |
120 | |
102 | |
87 | |
68 |