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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
RafDelgado
Helper II
Helper II

Dynamic RLS role creation based on role name

Hi All, 

 

Is it possible to have a dynamic RLS role filter based on the role name itself?

 

So for example:

 

Role name = '1677217'

Table filter:  ID = [Role name]

 

Or

 

Role Name = 'New York'

Table Filter: City = [Role Name] (so New york)

 

 

Thanks,

Raf 🙂

4 REPLIES 4
v-lili6-msft
Community Support
Community Support

HI, @RafDelgado 

You could try to use conditional that logic as this formula to add a RLS

IF(ISERROR(VALUE(USERNAME())), [City] = USERNAME(), [ID] = USERNAME())

2.JPG

Result:

Basic dataBasic dataRole name = '1677217'Role name = '1677217'Role name = 'A'Role name = 'A'

 

Here is pbix file. please try it.

 

Best Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hey @v-lili6-msft , 

 

Thanks so much for the reply. 

 

I think I may not have explained it properly, What I would like is something like the below.

 

 

 

 

2019-02-22_10-25-16.png 

 

But instead of the DAX expression being filtered on the manually typed 16777217, it uses the name of the role instead.

 

2019-02-22_10-29-51.png 

 

Meaning I could have mutliple roles with different number ids for what I want to filter but not have to go through each table to change the query.

Anonymous
Not applicable

I have the same issue. Did you solve it?

hi, @RafDelgado 

You could refer to this blog:

http://radacad.com/dynamic-row-level-security-with-manager-level-access-in-power-bi

 

Best Regards,

Lin

 

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors