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
Devender9999
Frequent Visitor

How to use selectedvalue in RLS

Hi Experts,
I have a case where I need to exclude one material from Product category when a  X type user logins but not exclude when other users login, 

 

X is a column in RLS table having values like x1,x2,x3 ect and Y column and similarly Z ,

X, Y,Z are type of users so I need when any user from X type logins he should not see one material let say "Pen" but when either of Y or Z logins it should be visible.

 

now there is additional requirement that when a admin login then he should able to see what visible to X, Z and Y by selecting values from slicers of X,Y,Z so when he select any values from X slicer then "pen" material should be excluded 


Modeling is as 

1. RLS table having email, X,Y,Z  columns 

2. Bridg table between RLS and Customer table and RLS and bridge table is connected on many to many values of many values 

  and Bridge and customer table is connected on many(bridge) to one (customer) in both direction 

3. Fact table connected to customer and material table many (fact table) to one

 

in breif there is two requirement 

1. to exclude "pen" when any user from X type column logins-- that is i have achieved somehow

2. to give additional functionality when a admin login , he should be able to see what visible to X, and what visible to Y,Z  

 

i tried to use selected value but i dont get required output 

 

can anyone please provide any suggestion/solution

 

Thanks

 

2 REPLIES 2
Anonymous
Not applicable

Hi,

You can achieve this by maintaining a table having the email ids in one column and user type in another column. For example, Admin (User type) should be able to see all values, for that the following DAX has to be used:

Restrict User =
VAR UserCategory =
    CALCULATETABLE (
        VALUES ( 'USER_ACCESS'[USER_TYPE] ),
         'USER_ACCESS'[EMAIL_ADDRESS]= USERPRINCIPALNAME()   )
RETURN
if(UserCategory="Admin",Materials[Material_Name],"Restricted")
Likewise we can restrict the User based on what he/she wants to view.

Thanks for response, I am able to restrict when X type users logins and if admin or Y, Z type user login they can see the material but what i need that when a Admin logins then he can see what visible to X type an what visible to Y or Z 

Let say we have three product Pen-- 10

                                                 Pencil ---20

                                                 ruler --- 30

so when X logins he see only pencil and ruler let says sum of 20+30 = 50
 and when any one else logins He sees all pen, pencil and ruler , 10+20+30= 60

 

now i have scliers of X (x1,x2,x3 ) and similary sclier for Y and Z 

Now a admin who has access to all data what to see what visible to X users and select x1 from sclier he should see only pencil and ruler not pen 

but when select a value from Y or Z then he see all pen,pencil and ruler

 

can we achive this?

 

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.