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

Dynamic Row Level Security data setup and questions

Hi all.

 

I'm building a report with multiple levels of managers (rep, district manager, regional managers, sales director) needing access to only their data. Sales director would see whole group, regional managers would only see results from their DMs and reps, DMs would only see their reps.

 

Assuming we structure our data roughly like this below - with the org structure essentially set up in the data, and with the entire report sliceable by these roles, will this work for dynamic RLS without having to set up paths or do anything else complicated?

 

Screenshot_20230126_084604.png

 

So, can I set up a Sales Director role with "Sales Director email = USERPRINCIPALNAME()", and then another role for RDs as "Regional Director email = USERPRINCIPALNAME()" from a different column in the same table, and should that work when users log in? Or can you create one role (permissions) with "Sales Director email = USERPRINCIPALNAME()" + "Regional Director email = USERPRINCIPALNAME()" , etc?

 

Important note: I tested this, and when I "view as" a certain email address in Desktop, it filters as if should. But when I actually published to the service and sent it to someone in the data list, they saw the entire report and not just their data. Note I did add that one test email address into the security settings in Power BI service. 

 

Can anyone help me sort through this? Thank you!!

6 REPLIES 6
otravers
Community Champion
Community Champion

I would target AAD security groups rather than individual users, it will be easier to maintain. See the RLS link in my signature.

------------------------------------------------
1. How to get your question answered quickly - good questions get good answers!
2. Learning how to fish > being spoon-fed without active thinking.
3. Please accept as a solution posts that resolve your questions.
------------------------------------------------
BI Blog: Datamarts | RLS/OLS | Dev Tools | Languages | Aggregations | XMLA/APIs | Field Parameters | Custom Visuals
shadow9600
Frequent Visitor

In order for RLS to work right in the service, you need to first add the users to the report dataset security, then  publish the report into an app (making sure the users have permission to the app), AND ensure the users are NOT members of the workspace the report is in. When a user is a member of the worksapce all RLS is bypassed for that user.

@shadow9600 Thanks - I did discover that was why my internal test wasn't working. Didn't realize you have to apply permissions in two places. 

freginier
Solution Specialist
Solution Specialist

import your data + user data 

create one RLS  'user date' [email] = USERPRINCIPALNAME()

link your data + user data and then your data will be filtered 

 

______________________________________________________

If you found this post helpful, please give Kudos C

@freginier In this scenario, you are saying that all user data would have to be in one dimension table, and all email addresses would have to be in the same column within that table (as opposed to split how I have it now, with org structure built out through different columns)?

 

How would you handle org structure in that case?

 

Thanks!

Yes you need to add file with all users something like : email , Role (director, manager, etc.)

Maybe I can help you anymore if you send your power bi without sensitive data 

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 Kudoed Authors