Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi,
I try to implement RLS in Direct Query Report Server, with this dax:
var vProfileRole = CALCULATETABLE (VALUES ( DIM_REL_OWNER[ROLE] ),
DIM_REL_OWNER[NPK]&"@company.com"=UserPrincipalName()
)
var vProfileBM = CALCULATETABLE (VALUES ( DIM_REL_OWNER[BRANCH_CD] ),
DIM_RELATIONSHIP_OWNER[NPK]&"@company.com"=UserPrincipalName(), DIM_REL_OWNER[ROLE]="BM"
)
var vProfileHOA = CALCULATETABLE (VALUES ( DIM_REL_OWNER[BRANCH_CD] ),
DIM_REL_OWNER[NPK]&"@company.com"=UserPrincipalName(), DIM_REL_OWNER[ROLE]="HOA"
)
return
Switch(
TRUE(),
vProfileRole = "BM", [BRANCH_CD] = vProfileBM),
vProfileRole = "HOA", [AREA_CD] = vProfileBM, FALSE()
)
But that dax give me error like this : function "PLACEHOLDER" is not allowed as part of row level security expression on Direct Query models.
Any idea for fixing the error?
Thanks
Tegar
the error still arise, i'm sorry that typo in this thread. in the actual file theres no parentheses
I've found some solution with change the variable dax like this:
var vProfileBM = SELECTCOLUMNS(FILTER(DIM_REL_OWNER, DIM_REL_OWNER[NPK]&@company.com"=UserPrincipalName() && DIM_REL_OWNER[ROLE]="BM"), "Branch", DIM_REL_OWNER[BRANCH_CD])
But it give me bad performance, that take lot of time for every action in dashboard.
Any other dax way for the best performance with short load time?
Hi, @tegar
Please look at the highlighted part in my screenshot, there seems to be extra parentheses in the formula. Please delete and test again.
Best Regards,
Community Support Team _ Eason
| User | Count |
|---|---|
| 50 | |
| 40 | |
| 32 | |
| 14 | |
| 13 |
| User | Count |
|---|---|
| 87 | |
| 73 | |
| 37 | |
| 28 | |
| 26 |