Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
I have a Data Table as shown below :-
Territory ID | Value | SKU ID |
1 | 11 | 22 |
1 | 22 | 23 |
1 | 33 | 22 |
2 | 44 | 23 |
2 | 55 | 22 |
2 | 66 | 23 |
3 | 77 | 24 |
3 | 88 | 24 |
3 | 99 | 22 |
4 | 12 | 25 |
4 | 13 | 26 |
5 | 14 | 25 |
6 | 32 | 24 |
6 | 54 | 24 |
6 | 45 | 27 |
6 | 67 | 27 |
I have two other tables, one for Territory ID mapping and the other for SKU ID mapping.
As shown below :-
Territory Table :-
Territory ID | Email Id |
1 | A@gmail.com |
2 | A@gmail.com |
3 | d@gmail.com |
4 | bb@gmail.com |
5 | cc@gmail.com |
6 | cc@gmail.com |
7 | A@gmail.com |
8 | k@gmail.com |
1 | c@gmail.com |
1 | dd@gmail.com |
2 | dd@gmail.com |
3 | dd@gmail.com |
4 | dd@gmail.com |
SKU Table :-
SKU ID | |
22 | mk@gmail.com |
23 | A@gmail.com |
24 | m@gmail.com |
25 | b@gmail.com |
26 | mk@gmail.com |
27 | A@gmail.com |
22 | A@gmail.com |
23 | mk@gmail.com |
25 | mk@gmail.com |
The Territory and SKU tables are linked to Data Table with a Many to Many Relationship
I want to apply Row Level Security such that the rows in the Data Table are filtered
according to the user logged in and they should be able to view only the Territory or SKU assigned to them.
So if user dd@gmail.com logs in them the Output should be :-
Territory ID | Value | SKU ID |
1 | 11 | 22 |
1 | 22 | 23 |
1 | 33 | 22 |
2 | 44 | 23 |
2 | 55 | 22 |
2 | 66 | 23 |
3 | 77 | 24 |
3 | 88 | 24 |
3 | 99 | 22 |
4 | 12 | 25 |
4 | 13 | 26 |
dd@gmail.com only exists in Territory Table hence only filter from that table
if user mk@gmail.com logs in them the Output should be :-
Territory ID | Value | SKU ID |
1 | 11 | 22 |
1 | 22 | 23 |
1 | 33 | 22 |
2 | 44 | 23 |
2 | 55 | 22 |
2 | 66 | 23 |
3 | 99 | 22 |
4 | 12 | 25 |
4 | 13 | 26 |
5 | 14 | 25 |
mk@gmail.com only exists in SKU Table hence only filter from that table
if user A@gmail.com logs in, then the Output should be :-
Territory ID | Value | SKU ID |
1 | 11 | 22 |
1 | 22 | 23 |
1 | 33 | 22 |
2 | 44 | 23 |
2 | 55 | 22 |
2 | 66 | 23 |
A@gmail.com exists in both Territory and SKU Table hence filter from both the tables.
How should I go about creating Row Level Secutrity on these two independent tables?
Try the below DAX in RLS,
Table - SKU:
IF(USERPRINCIPALNAME() IN VALUES(SKU[Email]),[Email]=USERPRINCIPALNAME(),TRUE())
Table - Territory:
IF(USERPRINCIPALNAME() IN VALUES(Territory[Email Id]),[Email Id] = USERPRINCIPALNAME())
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
9 | |
7 | |
6 | |
6 |
User | Count |
---|---|
20 | |
11 | |
10 | |
9 | |
6 |