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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
NAV_81
Frequent Visitor

Dynamic RLS Across Different Columns

I am hoping someone can help me with Dynamic RLS, I work for a Pharmacy group at the Head Office Level and have been tasked with setting up Power BI for our Company. The Data that I need to restrict will be from different columns, For Example:

 

Head Office Staff - Can See ALL Stores

Corporate Store Owner - Can see All Corporate Stores (Not Franchisee stores)

Pharmacist Manager - Can only see the Store/Stores they Manage

Sales Assistant - Can only see the store they work in

 

My Store Data has 3 Columns that the RLS could be filtered by Pharmacy Type, Pharmacy Group, LocationID or LocationCode

 

CorporateGroup4801Location_801
CorporateGroup9802Location_802
CorporateGroup3803Location_803
CorporateGroup1804Location_804
CorporateGroup7805Location_805
CorporateGroup3811Location_811
CorporateGroup5812Location_812
CorporateGroup10816Location_816

 

I have looked at a heap of different examples but I can't seem to find an example where I can see how I would even go about structuring or setting this up. 

 

I have created a sample Data File which may help explain what I am trying to do.

https://www.dropbox.com/scl/fi/s0qkhhlnvkb3e7y709s00/Dynamic-RLS-Sample.xlsx?dl=0&rlkey=x5zu5qxztsn8...

 

I am quite new to Power BI so any help/advice would be greatly appreciated.

1 ACCEPTED SOLUTION

Hi , @NAV_81 

You may need to  use USERNAME()/USERPRINCIPALNAME() function to implement dynamic row level security .

Please check  if  the workaround  as described  in this thread helps.

https://community.powerbi.com/t5/Desktop/DAX-Code-for-Dynamic-RLS/td-p/807960

 

Best Regards,
Community Support Team _ Eason

View solution in original post

4 REPLIES 4
TaxiDriveDax
Frequent Visitor

Hi @NAV_81

Did u manage to find the solution ?

May you please share 

Thanks @amitchandak there are a few articles there I haven't read, but I'm still not sure how I can make this work for me. All of these examples are all filtering from 1 column, where I have 3 possible columns to filter on dependant on who is accessing the data.

 

I think I'm wanting some guidance on how best to set this up, I just can't seem to get me head around it.

Hi , @NAV_81 

You may need to  use USERNAME()/USERPRINCIPALNAME() function to implement dynamic row level security .

Please check  if  the workaround  as described  in this thread helps.

https://community.powerbi.com/t5/Desktop/DAX-Code-for-Dynamic-RLS/td-p/807960

 

Best Regards,
Community Support Team _ Eason

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors