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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anonymous
Not applicable

Dax Expression for Dynamic Row level security

Hi I have the following model below which is linked via the Level 4 ID(highlighted in red). In order to avoid a many to many relationship i have created a bridge table(ruf contract bridge). i have already created a dynamic RLS on the corporate RLS Access table(picture 2) however i am wondering what dax expression do i need to create for the bridge table in order for this to filter the UK & ROI Monthly Debt tables i have? 

Picture 1Picture 1roles pic now.PNG

1 ACCEPTED SOLUTION


@Anonymous wrote:

Hi thanks for your response, Yes i understand that would be the easy fix and would work however was wondering about the other way to do it via DAX in which can filter these tables. 


So if you want the harder to implement solution with worse performance you could probably do something like the following on the 'RUF Contract Bridge' table. 

 

'RUF Contract Bridge'[Level 4] in CALCULATETABLE( VALUES('Corporate RLS Access'[Level 4]), 'Corporate RLS Access'[Email] = USERPRINCIPALNAME() )

View solution in original post

4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

You can also consider directly using the Dax expression to lookup values from the 'user' mapping table and extract the result to apply the filter on the bridge table. (it can be used without fact relationship)
Then you can set the RLS filter expression on the bridge table let other related tables with 'both' direction relationships enable RLS filters to tables. (notice: you need to ensure the RLS filter table and other table relationships direction are 'both' to expand the filter effects or it will be only enabled RLS on the filter table itself)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Anonymous
Not applicable

Hi thanks for your response, Yes i understand that would be the easy fix and would work however was wondering about the other way to do it via DAX in which can filter these tables. 


@Anonymous wrote:

Hi thanks for your response, Yes i understand that would be the easy fix and would work however was wondering about the other way to do it via DAX in which can filter these tables. 


So if you want the harder to implement solution with worse performance you could probably do something like the following on the 'RUF Contract Bridge' table. 

 

'RUF Contract Bridge'[Level 4] in CALCULATETABLE( VALUES('Corporate RLS Access'[Level 4]), 'Corporate RLS Access'[Email] = USERPRINCIPALNAME() )

d_gosbell
Super User
Super User

Just change the filter direction of the relationship between the 'Corporate RLS Access' table and the 'RUF Contract Bridge' table to be bi-directional (so the arrows go both ways). And then your existing RLS filters will flow through to the other related tables.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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