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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
jt197b
Frequent Visitor

How to Toggle RLS using a Slicer?

Hi,

 

I'm trying to implement a RLS "toggle" to switch RLS off and on for a role. Basically, if RLS is on, the view defaults to display only the user's information.

 

If it is off, then the user can see all the information in the table.

 

This is the DAX expression I'm using for my RLS:

jt197b_0-1658778438441.png

 

As you can see, it's a simple formula. But the toggle isn't working.... its hiding all data no matter what. Can anyone please assist?

 

Thanks!

2 REPLIES 2
bcdobbs
Community Champion
Community Champion

You might be able to adapt this approach which has RLS applied to a disconnected table and then uses a calculation group which could be switched on and off to pass the filter.

 

https://dobbsondata.co.uk/2022/03/08/calculation-groups-and-rls/



Ben Dobbs

LinkedIn | Twitter | Blog

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
v-jingzhang
Community Support
Community Support

Hi @jt197b 

 

I'm afraid this is not possible. The table filter DAX expression is applied to the table where you set it. It evaluates every row in the table but it's not able to get the selected value from a slicer. Slicers and filters in the report cannot affect this DAX expression, so selectedvalue() function always return blank. It's just similar to creating a calculated column in the table, which only considers the row context and cannot be affected by user interactions with slicers/filters in the report. 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.