Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
mohit_K
Helper I
Helper I

Row Level Security

I have a Data Table as shown below :-

Territory IDValueSKU ID
11122
12223
13322
24423
25522
26623
37724
38824
39922
41225
41326
51425
63224
65424
64527
66727

 

I have two other tables, one for Territory ID mapping and the other for SKU ID mapping.
As shown below :-
Territory Table :-

Territory IDEmail Id
1A@gmail.com
2A@gmail.com
3d@gmail.com
4bb@gmail.com
5cc@gmail.com
6cc@gmail.com
7A@gmail.com
8k@gmail.com
1c@gmail.com
1dd@gmail.com
2dd@gmail.com
3dd@gmail.com
4dd@gmail.com

 

SKU Table :-

SKU IDEmail
22mk@gmail.com
23A@gmail.com
24m@gmail.com
25b@gmail.com
26mk@gmail.com
27A@gmail.com
22A@gmail.com
23mk@gmail.com
25mk@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 IDValueSKU ID
11122
12223
13322
24423
25522
26623
37724
38824
39922
41225
41326


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 IDValueSKU ID
11122
12223
13322
24423
25522
26623
39922
41225
41326
51425

 

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 IDValueSKU ID
11122
12223
13322
24423
25522
26623


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?

1 REPLY 1
SivaMani
Resident Rockstar
Resident Rockstar

@mohit_K,

 

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()) 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.