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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
adambhappy
Resolver II
Resolver II

Using filter slicer to dynamically apply RLS to achieve a default filter

I'm building a report that will be used by sales people to view sales figures per customer and the report contains the data for all customers within the company. The users are supposed to be able to access the information for all customers but when they initially log in to the report I want it to be filtered on their customer.

 
Below is a screenshot of the filters at the top of the report, the Own customers / All customers filter is a manual table entered into Power BI which is not connected to any of the other tables.

 

PBI_Question_RLS_Dynamically_Slicer.png

 

So I've been playing around with using SELECTEDVALUE on the Customer filter field to use an IF conditional statement in RLS to filter the customer table but I can't seem to get it to work properly. Below is the code I've tried in RLS on the customer table but it doesn't seem to work the they I want it to.

 

IF((USERPRINCIPALNAME()>customers[upn]&&SELECTEDVALUE(filter_table[Customer filter],"All customers")="Own customers"),0,1) = 1


Using SUMX() on the customer table I can get the IF-statement to properly evaluate on row level but I'm thinking that there is something about how/when RLS is computed that means that my approach won't work.

Has anyone done something similar where you've used the selected value in a slicer to apply RLS?

2 REPLIES 2
v-juanli-msft
Community Support
Community Support

Hi @adambhappy

"The users are supposed to be able to access the information for all customers but when they initially log in to the report I want it to be filtered on their customer."

 

you mean:

your end users have the permission to see all data,

but when they open the report for first time, they can only see their own data.

meanwhile, on the report, there is a slicer which is selected at "own customer" by default.

to see all data, user can switch "own customer" to "all".

 

Right?

 

Best Regards

Maggie

Yes, that is the scenario I'm trying to achieve. I can create a DAX measure that evaluates to 1 for each customer based on a combination of the two conditions: they own the customer or they have selected to show all customers. However I can't use that as a filter in the slicer where they select the customer.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Kudoed Authors