Forum Discussion
Dynamic Row Level Security
- 1 year ago
This is what my department has been tasked with to mirror PBI to what other data individuals see in our other systems. Filtering down to just show what they have full access to is in the RLS table was what I started with, but now we need to make sure they can see all employees (not just the filtered down people) but only have access to their permissioned data for sensitve data fields with other values just simply being blank.
That was the original code we tried and it worked to filter out to what sensitive they should see, but then they lost visibility of all other rows of data that were not sensitive. The goal is to show all non-sensitive data and let the RLS show sensitive data and blank values for those they don't have access to (i.e. they still have all rows of data in the displayed table but the column with position grade will only show either 1-5 or blank values).
This is the behaviour of RLS - it filters, i.e you can only see rows that an employee is configured to see.
You could potentially scrap the RLS idea and create measures that link to your RLS table (RLS roles are not configured though) Use dax to SWITCH measures by looking up agaisnt your RLS table, i.e If a user is configured to see data then present it, if not BLANK() out the value.