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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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

Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.