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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ogend
Helper I
Helper I

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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