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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount 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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

Top Kudoed Authors