Forum Discussion
RLS DAX Modeling Help
Hello,
I am curious for assistance with what the correct function would be to resolve the following DAX statement to configure RLS:
The goal is to have a primary & secondary users (ie Salesforce Account Household Import) both have access to the same RLS-enforced data. An example outcome would be Primary Household User associated data (Enforced by Email address field connected to User Prinicpal Name) is accessible by the secondary household user (via accountID).
[Email Address]=
VAR CurrentUserEmail = UserPrincipalName()
VAR CurrentUserAccount = SELECTEDVALUE('Custom Table'[Custom Table_Contact__c])
RETURN
IF(
CONTAINSROW(
FILTER(
ALL('Contact'),
'Contact'[AccountId] = CurrentUserAccount
),
'Contact'[workemail__c] = CurrentUserEmail
),
CurrentUserEmail,
BLANK()
)
3 Replies
- parry2kSuper User
flyzone not fully sure what you are looking for. It will be easier if you post some data with the expected result. Read this post to get your answer quickly.
https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490- flyzoneFrequent Visitor
I am looking more for the appropiate syntax or function surrounding the CONTAINSROW line. I want to filter the data by connecting the current user email to the respective work email field which concurrently will match the current user account to all work emails within the specfic user accountid. Essentially two users share an accountid which both need RLS access to the same dataset.