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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

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 

amitchandak
Super User
Super User

@NAV_81 . refer if these can help for RLS

https://community.powerbi.com/t5/MBAS-Gallery/Microsoft-Power-BI-Unleash-row-level-security-patterns...
https://radacad.com/dynamic-row-level-security-with-organizational-hierarchy-power-bi
https://www.blue-granite.com/blog/using-dynamic-row-level-security-with-organizational-hierarchies
https://docs.microsoft.com/en-us/power-bi/service-admin-rls
https://blog.tallan.com/2018/04/10/row-level-security-in-power-bi-part-1-roles-and-users/

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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