This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowThe Fabric community is upgrading! Read all of the details including the timeline and what you can expect. Learn more
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 :-
SKU Table :-
| SKU ID | |
| 22 | [email protected] |
| 23 | [email protected] |
| 24 | [email protected] |
| 25 | [email protected] |
| 26 | [email protected] |
| 27 | [email protected] |
| 22 | [email protected] |
| 23 | [email protected] |
| 25 | [email protected] |
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 [email protected] 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 |
[email protected] only exists in Territory Table hence only filter from that table
if user [email protected] 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 |
[email protected] only exists in SKU Table hence only filter from that table
if user [email protected] 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 |
[email protected] 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?
Hi @mohit_K,
Did this suggestion help with your scenario? if that is the case, you can consider Kudo or accept it to help others who faced similar issues.
If these also not help, please share more detailed information to help us clarify your scenario to test.
How to Get Your Question Answered Quickly
Regards,
Xiaoxin Sheng
HI @mohit_K,
Perhaps you can write two search expressions to lookup values from different tables to get 'SKU id' and 'Territory id' based on USERNAME function.
Then you can use filter both two fields with 'OR' logic on the 'mapping' table at the same time.
Regards,
Xiaoxin Sheng
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
| User | Count |
|---|---|
| 24 | |
| 22 | |
| 20 | |
| 18 | |
| 14 |
| User | Count |
|---|---|
| 44 | |
| 36 | |
| 23 | |
| 20 | |
| 20 |