Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet 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
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.
Hi @stevenvd
Please refer to these documents first.
If you have any problem to implement in your scenario, please let me know.
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
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
92 | |
83 | |
71 | |
49 |
User | Count |
---|---|
143 | |
120 | |
110 | |
59 | |
57 |