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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.