Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
markpatton
Helper I
Helper I

Disable RLS for a measure

Is there anyway to disable RLS for a measure. I have active (B) and inactive (A) relationships  in my model. In order to make a caclculation(measure) I have a measure where I deactivate a relationship (B) and activate another (A) using crossfilter and userelationship respectively.

 

Private Flying - Trips - Owner Other = (calculate(sum('GL - GENERAL LEDGER DETAILS'[Line Amount]), crossfilter('RLS-Plane ID'[registration],'Trip filters'[Plane], none), USERELATIONSHIP('RLS-Plane ID'[registration], 'GL - Customers'[CustomerPlane]), 'GL - Customers'[Customer Type] = "Owner", 'public financials'[135_91] = "135", 'GL - Account'[Account Number] = "11000") - calculate(sum('GL - GENERAL LEDGER DETAILS'[Line Amount]), crossfilter('RLS-Plane ID'[registration],'Trip filters'[Plane], none), filter('GL - GENERAL LEDGER DETAILS', related('GL - Customers'[CustomerPlane]) = related('Trip filters'[Plane])), 'GL - Customers'[Customer Type] = "Owner", 'public financials'[135_91] = "135", 'GL - Account'[Account Number] = "11000")) * -1
 
This works fine until I view with RLS. When using RLS I get a circular dependency from the GL table to the RLS Plane ID table 
 
markpatton_0-1643670416598.png

This is my model. I have marked the relationships that create the two paths with A and B.

 

markpatton_1-1643670596470.png

 

It appears to me that the path of B is not disabled which I thought would be the case with the crossfilter statement in the measure. 

 

Any suggestions on how this can be done?

2 REPLIES 2
lbendlin
Super User
Super User

Are the security filters applied in both directions between the General Ledger table and the dimensions pointing at it?  Why the bidirectional joins there?

Thanks for the response. I have bi-directional joins to look up data in both directions. But I still get this error when I using relationships in the single direction. I change the model to test. 

 

markpatton_0-1643931466520.png

This is an example of my relationship to GL Leger. Since I'm using 1 to many the box for security filter in both directions does not show up.

markpatton_1-1643931565537.png

 

Helpful resources

Announcements
FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.