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
stevenvd
Regular Visitor

Row Level Security

Hi,

 

I need to implement RLS based on usernames. A user can have access to 1 or more companies. There is a sales table that contains intercompany sales. A user is allowed to see the sales of his company but also what is bought from the company.

security, rls

In the example below we have user X who has access to company ABC. The transaction table contains a column for company and a column for intercompany. In the first record company ABC sells to QQQ, in the second record to NVA and in the third record ABC purchases from NVA.

 

ABC should see all 3 records but if I connect the company from security table with company from fact table only 2 records will be shown cause company in fact table is filtered for ABC. 

 

I cannot figure out how to implement the security. Any directions you could point me into are more than welcome. Maybe I need to use SQL to do some manipulation on the data... Don't know but will keep on trying to find a solution.

 

Capture.PNG

1 REPLY 1
v-juanli-msft
Community Support
Community Support

Hi @stevenvd 

Please refer to these documents first.

If you have any problem to implement in your scenario, please let me know.

RLS with Power BI

Row-Level Security in Power BI: Part 1 – Roles and Users

Dynamic RLS with manager level

 

To implement RLS based on usernames, you need a table which has user email and user name accordingly.

then relate this table with the "security" table. 

 

Best Regards

Maggie

 

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.