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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
FelipePalomino
Frequent Visitor

Row Level Security with multiple tables

Hello everyone! 🤓

 

I have a dimension and a fact table, and I need to apply some conditions for a especific function in RLS.

My dimension table has Code and Department (each department can have a variety of codes).

This works well, I can set the access accordingly to the departments, so each person only sees specific groups of codes (and sometimes some codes from other departments).

 

My problem is when I need to apply a second condition (that is not on this table).

 

I have a column with names in my fact table, and sometimes people needs access to a specific set of nomes. The RLS should be as follows:

 

See Department x and Codes 1, 2 and 3 (from the dimension table) plus any rows with the name "abc" (in the fact table), even if this person is not on one of the department or codes listed before.

 

Is it even possible?

Should I create another dimension table for this to work (maybe just a simple summarize). If so, what would the code look like?

 

Really appreciate if anyone can help! 😊

2 REPLIES 2
amitchandak
Super User
Super User

@FelipePalomino , Are they from the same table, department, and code? You can create a table Department. Code, Email, and dim key and can join if with dimension and apply RLS

 

If from two different tables. Have two tables and join with respective dim and add in same role

 

Power BI- Row Level Security: Handle ALL, UserPrincipalName: https://youtu.be/KVLEnIUo4pc

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

This is how my tables look like:

Table 1 - dDepartment (dimension)

CC Code | Department

1       | Dep 1

2       | Dep 1

3       | Dep 1

4       | Dep 2

5       | Dep 2

6       | Dep 3

 

Table 2 - dFunctions (Department)

Function Code | Function Area

1       | Area 1

2       | Area 1

3       | Area 1

4       | Area 2

5       | Area 2

 

In my fact table, I have several columns, with Function Code and CC Code being two of them.

 

I want to create a RLS function that limits  the access based on both dimension tables, like this:
Department 1 OR Area 1

So the person accessing can see BOTH the CC Codes of Department 1 AND Function Codes of Area 1.

They need to see both population, even if I have someone on Area 1 that belongs to Department 2.

 

My problem is, if I create a functions with this restriction on both tables, the person would only be able to see people the rows that fit both restrinctions, and not only one of them.

 

Is it clear now? Let me know if I need to develop further.

 

Thanks! 😉

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.