Forum Discussion
RLS doesn't work with bidirection dax
First, change the bidirectional crossfilter to unidirectional (this is a best practice in data modeling). Here's the data model (I renamed the tables to be more descriptive):
Use the DAX below in the role for the Entity table:
[EntityNo] IN
CALCULATETABLE (
VALUES ( AreaCustEntity[EntityID] ),
CROSSFILTER ( AreaUser[AreaID], AreaBridge[AreaID], BOTH ),
AreaUser[UserID] = USERPRINCIPALNAME ()
)
The CALCULATETABLE function allows you to set the crossfilter direction to "both", which is necessary due to the unidirectional relationship between AreaUser and AreaBridge.
- PBIUser-Sap4 years agoFrequent Visitor
Thanks for checking!! DAX above works. But we face another issue, The record count (for AreaCustEntity) is different when RLS was applied through AreaUser to that of now where RLS is applied on Entity. All other tables in the model are filtered via AreaCustEntity so now we are not sure how we can fix this.
Can I reach you over mail for queries, anyway i am available at [email protected]
- DataInsights4 years agoSuper User
Glad to hear the DAX works. Would you be able to provide an example illustrating the record count issue?
- PBIUser-Sap4 years agoFrequent Visitor
If it is more convenient to you I can share recordings of the example with you. If you agree with that please share a contact if possible
- PBIUser-Sap4 years agoFrequent Visitor
Hi,
Sure..
for example, When RLS is applied theough AreaUser total count of AreaID in report layer is different than when RLS is applied through Entity table using above DAX.