powerbidaxrow-level-security

Trying to find a DAX Function for RLS Filtering in Power BI


I have a table that lists out the following columns:

ID | Division | Email | Name

This table is linked within my datasource and I want to use it to filter rows in Power BI. However instead of simply matching the USERPRINCIPLENAME() to the email, I want to create a rule that allows the viewing user to see all rows that match their own given Division value from the table. For SQL I would imagine this would be a simple subquery but I'm less familiar with writing DAX expressions and would love some expertise. Thank you.


Solution

  • I was able to solve this using the below Dax formula:

    [Division]=

    LOOKUPVALUE( [DIVISION], [Email], USERPRINCIPALNAME())