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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
Anonymous
Not applicable

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

View solution in original post

1 REPLY 1
Anonymous
Not applicable

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors