Row Level Security (RLS) can be used to restrict access to data in a Power BI report.
Row Level Security (RLS) can be used to restrict access to data in a Power BI report based on a user’s Power BI Service login credentials. The RLS has to be set up on each dataset.
Using the DAX function makes it easier to set up the row-level security. Below are the examples.
Returns a delimited test string with identifiers for all the parents of the current identifier. This will generate the complete organizational hierarchy based on the staff dimension table. Org Hierarchy = PATH(Org[EMP_ID],Org[Manager])
Returns the item from the specific position from a string resulting from using he PATH() function. This can be used to identify a specific level in the hierarchy. Org Level 1 = LOOKUPVALUE('Org'[Emp_UserPrincipalName], 'Org'[EMP_ID], PATHITEM(Org[Org Hierarchy],1,TEXT) )
Returns the user in the format of their user principal name, i.e. test@maine.edu (email address). To test the role, replace the USERPRINCIPALNAME() function with a hardcoded value.
[UserPrincipalName] = userprincipalname()