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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Devender9999
Frequent Visitor

To show admin user what other user of type A,B,C

I have a product table where i have classified product family into P1,P2,P3 where i have put product x in P1 , now i have a  RLS  table having email, type of user like A,B,C 
so let say if user of type A, B login then they should see the Product x in P1, but when user type C logins he shoudlnot see X in P1 
so for this i have implemented RLS rule on table product and created a column in RLS table where get 1 if user type is C else 0 , and the rule is calculate max of column when equals to 1 then filter product table not having product x in it ,

so if C logins he wont see X in P1 but others can

Now i have another issue that when admin logins and if he filters by slicer values of A,B,C there are values under this , so if he select values from A or B he should see what visible to Type A/B user type and when select C he should see what visible to C that is he should not see X when select C value

Can anyone please suggest

Thanks you 

4 REPLIES 4
rubayatyasmin
Super User
Super User

Hi, @Devender9999 

 

you want to implement Row-Level Security (RLS) with additional functionality for an admin user.

From your description, I'll break it down step by step:

  1. Basic RLS Rule:
    • Users of type A and B should see Product x in P1.
    • Users of type C should NOT see Product x in P1.
  2. Admin User Rule:
    • When the admin uses a slicer to filter by A or B, they should see what A or B users see.
    • When filtering by C, they should see what C users see.

 

Refer: https://learn.microsoft.com/en-us/power-bi/enterprise/service-admin-rls

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


thanks for your response, yes thats exactly what i need, but not sure how to do it ? by measure can we achive it?? 

Follow these steps. Also check the document on how to implement RLS.

 

  • In your RLS table, you have a column that assigns a 1 if the user type is C and 0 otherwise. Let's name this column IsTypeC.

  • Create an RLS rule:

  • [IsTypeC] <> 1 || ([Product Family] <> "P1" || [Product] <> "X")
  • The logic here is that the data will be visible either if the user is not of type C (IsTypeC <> 1) or if the product isn't X in P1.

    2. Implement the Admin Logic

    For the admin user, you need to modify the rule to take into account the slicer selection:

    Firstly, create a disconnected table for your slicer (let's name it AdminSlicer) that has a single column called UserType with values A, B, and C.

    Now, modify the RLS rule to:

  • IF(
    USERNAME() = "admin@email.com",
    SWITCH(
    SELECTEDVALUE(AdminSlicer[UserType]),
    "A", [IsTypeC] <> 1 || ([Product Family] <> "P1" || [Product] <> "X"),
    "B", [IsTypeC] <> 1 || ([Product Family] <> "P1" || [Product] <> "X"),
    "C", [Product Family] <> "P1" || [Product] <> "X"
    ),
    [IsTypeC] <> 1 || ([Product Family] <> "P1" || [Product] <> "X")
    )

However, please keep in mind that Power BI's RLS doesn't recognize slicer values in the way you're thinking.

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Thanks alot appreciate you for such a great response, I may ask you should i need to write this dax in product table or in RLS table cause in your dax you are refering to columns from both tables and when i am writing it is giving error and one more thing to clarify that under type A,B,C there are values there are name of columns in RLS table for example let say a01 is a user under type A  
thank again

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.