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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
ogend
Helper II
Helper II

Row Level Security - 2 columns in the fact table with 'OR' logic

Hi Power BI Gurus, 

I was wondering if there is a way to set up RLS in this scenrio: 

 

Permissions  Table: 

EmployeeEntity
name1@domain.comEntity1
name2@domain.comEntity2
name3@domain.comEntity3
name4@domain.comEntity4

 

Fact Table structure: 

Entity InitiatingEntity ImpactedDataField1 DataField2
Entity1Entity3 2 abd
Entity2  5 dgs
Entity4Entity1 123 kjl;
Entity4Entity4 86 jhk
Entity3Entity2 687 ghkg

 

I need Employee to be able to access if their entity is either Initiating or Impacted?
I've done "straighforward" set up before where i'd only have one Entity column, but here I am stuck

 

Thank you!

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @ogend ,

According to your description, Here's my solution.
Don't make relationship between the two tables. In Manage roles, create a new role with two DAX filter expression:

1. Permissions Table.

[Employee] = USERPRINCIPALNAME()

2. Fact Table.

[Entity Initiating] =
MAXX (
    FILTER (
        'Permissions Table',
        'Permissions Table'[Employee] = USERPRINCIPALNAME ()
    ),
    'Permissions Table'[Entity]
)
    || [Entity Impacted]
        = MAXX (
            FILTER (
                'Permissions Table',
                'Permissions Table'[Employee] = USERPRINCIPALNAME ()
            ),
            'Permissions Table'[Entity]
        )

Get the correct result.

vkalyjmsft_0-1657776311491.png

vkalyjmsft_1-1657776372245.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please considerAccept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-yanjiang-msft
Community Support
Community Support

Hi @ogend ,

According to your description, Here's my solution.
Don't make relationship between the two tables. In Manage roles, create a new role with two DAX filter expression:

1. Permissions Table.

[Employee] = USERPRINCIPALNAME()

2. Fact Table.

[Entity Initiating] =
MAXX (
    FILTER (
        'Permissions Table',
        'Permissions Table'[Employee] = USERPRINCIPALNAME ()
    ),
    'Permissions Table'[Entity]
)
    || [Entity Impacted]
        = MAXX (
            FILTER (
                'Permissions Table',
                'Permissions Table'[Employee] = USERPRINCIPALNAME ()
            ),
            'Permissions Table'[Entity]
        )

Get the correct result.

vkalyjmsft_0-1657776311491.png

vkalyjmsft_1-1657776372245.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please considerAccept it as the solution to help the other members find it more quickly.

Thank you, @v-yanjiang-msft , this approach works great!

amitchandak
Super User
Super User

@ogend , You need to create two copies of the permission table, Join one with each. Then make two roles and assign both to the users. Two roles are OR

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

Helpful resources

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

June 2025 community update carousel

Fabric Community Update - June 2025

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