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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register 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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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