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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
alexlmiddleton
Frequent Visitor

Creating roles based on distinct values

Good morning!

I posted here yesterday, but realized overnight there's probably a far easier way to do what I'm trying to do.

 

Our data looks something like:

DepartmentEmployeeJob Class
0057 John Smith100
0058Frank Doe

101

0058John Jamieson107
0059Jane Friend115
0060Samuel Beckett100
0060James Joyce103
0061Alex Middleton103

We have (literally) hundreds of departments, and all of those departments need row level filtering to view their own data.  In programming (Python) terms, we need to take our list of department codes, turn it into a set (remove the duplicates), and then create a list of roles based on that set.  So, 0057, 0058, 0058, 0059, 0060, 0060, and 0061 turns into 0057, 0058, 0059, 0060, and 0061.

 

How can I mass create roles based on the unique values in a column?

 

Thanks!

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

Hi @alexlmiddleton ,

Normally dynamic RLS are based on username function.

For your requirement, you can apply RLS filter on value fields which you mentioned(use 'username' look up correspond value field and use this value to filter records).
After these steps, it will enable RLS filter effect based on username's department field.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @alexlmiddleton ,

Normally dynamic RLS are based on username function.

For your requirement, you can apply RLS filter on value fields which you mentioned(use 'username' look up correspond value field and use this value to filter records).
After these steps, it will enable RLS filter effect based on username's department field.

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.