I am working on a PowerBI report which requires RLS.
To simplify, let's say I have the following tables:
Table 1:
Sales, Account, ProductOwnerAccount, Owner, Region
Table 2
Userid, UserRegion, UserAccount
Scenario: Need to show two sets of tabular data:
- All Rows Where
Account = UserAccount
andRegion = UserRegion
- All Rows where
ProductAccount = UserAccount
,Account <> UserAccount
andRegion = UserRegion
The only way to achieve this seems to be RLS and using two roles with corresponding DAX filters.
However, if I apply two roles to the same user, the least restrictive one takes precedence and hence, both report will give the same result.
I tried to create a calculated table, but that does not allow using USERPRINCIPLENAME
as a filter.
I also tried to have a page level filter which could use a measure (which in turn uses USERPRINCIPLENAME()
), this is also not allowed.
Similarly, a calculated column on each row to specify if it's owned by the current user doesn't work.
Is there any other way? Am I missing something very basic?