A little late but... if you have multiple usernames assigned to a role, pass the usernames as a string path to RLS, parse it into a table, then return the row when it matches with a value in the column. It feels like a re-invention of the for loop...
We do this if we are not actually passing usernames, but for cases like multiple sales offices, or making a view that compares data from multiple user accounts, or when a user belongs to different hierarchies in an organization, or basically any time you want to use multiple filters..
example input using sales ids
//Username() = "020104010|020104061|020104303|020104304"
//DAX
var userIds = Username()
VAR tbl=
GENERATE (
GENERATESERIES(1,PATHLENGTH(UserIds),1),
ROW ( "Key", PATHITEM ( userIds, [value]))
)
VAR valueList =
SELECTCOLUMNS ( tbl, "Key", [Key] )
return [sales_id_column] in valueList
There is also a case when the table has a many to many relationship and cannot use multiple roles as identity. In that case the username looks like this:
Username() = "SalesHead:020104010|SalesLead:020104061|SalesUser:020104303"
and the code will have an extra step to parse the inner path after you change the ":" to a "|". This approach supports a claims-based authorization.