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

RLS Roles from Two Tables

Hello,

 

I have a need to write a number of RLS roles where it looks at department numbers from two different dimensions and provides results from one OR the other.  E.g. We have department numbers on two dimensions.  We want a role that looks to see if the department numbers match one OR the other.  

 

This is what I have been experimenting with so far:

 

DEFAULTDIMENSION[DEPARTMENT] = "D2040" || RESOURCE[RESOURCE_DEPARTMENT] = "D2040'

 

Does anyone have any thoughts with how I can get this to work?

 

Thanks,

 

Alex

3 REPLIES 3
nirvana_moksh
Impactful Individual
Impactful Individual

 This underlined part for the second section of it should have double quotes, you just have a single. Idk if that is the syntax error that you are getting -

 

DEFAULTDIMENSION[DEPARTMENT] = "D2040" || RESOURCE[RESOURCE_DEPARTMENT] = "D2040'

 

Also, do you have a these dimensions also present in the table wherein ultimately you want RLS to work and do you have a relationship set between these two DIM Tables and the other table?

Anonymous
Not applicable

Thanks for catching that syntax error.  That was just from me fat-fingering into this forum but it was not present in the DAX for the RLS role itself.  

 

And yes, we are working with a star-schema where both of these dimensions are present.

If those Dimensions exist in the other tables then just apply RLS on these two DIM tables will work fine as long as there is a relationship between all which there is. Lastly, dont forget to assign this RLS Role on the Power BI Service accordingly.

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 Fabric 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.