Forum Discussion
Applying Row Level Security using LIKE
- 1 year ago
Hi dancarr22 ,
Thanks for reaching out. You're correct that the STARTSWITH function isn't supported directly in the DAX expression editor within the "Manage Roles" interface for Row-Level Security. However, you can achieve the same functionality using the LEFT function or the SEARCH function in combination with a logical comparison.
For your use case, a simple workaround would be to use an expression like LEFT([DeptID], 2) = "HR", which effectively mimics the STARTSWITH behavior. Alternatively, you can use SEARCH("HR", [DeptID], 1, 0) = 1, which checks if "HR" appears at the beginning of the DeptID field. Either of these approaches should allow you to implement the desired RLS rule based on prefix filtering. Let me know if you need help applying this in your specific model.