Forum Discussion
Ben1981
9 months agoHelper III
RLS based on CONTAINSSTRING?
Hi, Is there a way with RLS to filter a column based on if a value is contained within a string? I have two tables setup, HR People and HR Hierarchy, no connected to each other but can be via ...
- 9 months ago
Hello Ben1981
try with this DAX code
In your RLS role definition (for table 'Dim HR Hierarchy')VAR _UserID =
MAXX(
FILTER('Dim HR People', 'Dim HR People'[Email] = USERPRINCIPALNAME()),
'Dim HR People'[ID Key]
)
RETURN
CONTAINSSTRING('Dim HR Hierarchy'[Path], _UserID)
If my response helped you, please consider clicking
Accept as Solution ✅ and giving it a Like 👍 – it helps others in the community too.
Thanks,
Connect with me on:
LinkedIn
Ahmedx
9 months agoSuper User
study this
VAR
GetUserID =
MAXX(
FILTER('Dim HR People',
'Dim HR People'[Email] = USERPRINCIPALNAME() ),
'Dim HR People'[ID Key] )
RETURN
CONTAINS('_Dim Hierarchy,'_Dim Hierarchy'[Path],GetUserID)
https://radacad.com/dynamic-row-level-security-with-organizational-hierarchy-power-bi