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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
jimmy7377
Frequent Visitor

Row Level security Filter over 4 tables

Hello friends and follow Power Bioneers

 

Im a relative Noob compared to alot of you so please go easy on me.

 

I am having some (I play done the some) issues with getting my RLS to work see below my Dax I have currently i have enclosed the Dump of my Tables realtionships, I cannot get it to filter accross the 4 tables, I have had to put in a roles table as it was creating a Many to many relationship from Users to Areas ( I can hear my Database trainer saying NO!) to created Roles table to force a Many to 1.

 

Relationships are as follows

Users table, User_Role to Roles table, Role

Roles table Role to Areas table, Area role

Areas Table Committee_Name to Wards table Committee name

Wards table, Postcode to Clients Table, Post code

 


[Committee_name] in SELECTCOLUMNS(
filter(
'Areas',
related('Users'[Email])= USERPRINCIPALNAME()
),

"Committee_Name", [Committee_Name]
)Relationships.PNG

One my dax is not working it tells me The Column'Users[Email]' either doesn't exists ot doesnt have a relationship to any table availble in the current context.

 

I have been round and round trying to get the filter to work. 

 

I hope i have enclosed enough for you to understand my issue, if not please let m eknow and I will be happy to add more.

 

Kindest regards,

 

Jimmy

 

 

 

1 ACCEPTED SOLUTION
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @jimmy7377 ,

 

try this.

[Role] IN SELECTCOLUMNS( FILTER(Users, Users[Email] = USERPRINCIPALNAME()), "Role", Users[User_Role])
Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


View solution in original post

7 REPLIES 7
mwegener
Most Valuable Professional
Most Valuable Professional

Hi @jimmy7377 ,

 

try this.

[Role] IN SELECTCOLUMNS( FILTER(Users, Users[Email] = USERPRINCIPALNAME()), "Role", Users[User_Role])
Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


@mwegener  Thank you kindly for your help on this.

 

It is telling me Column 'Role' Cannot be found or may not be used in this expression Refering to the first [Role] Move it to Committee Name it then accepted it but when applied would not show any Committee _Name and would not filter Area_role or Role.

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @jimmy7377 ,

 

you have to set the table filter on the table Roles.

User2RLS.png

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Hi @mwegener

 

ah i had it on the Wards table.

 

I moves it to the Role but still getting the same :

 

 

rls issue.PNG

mwegener
Most Valuable Professional
Most Valuable Professional

Hi @jimmy7377 ,

 

the screenshot shows the Users table not the Roles table...

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


See complete plonker.

 

thakn you so much, that seems to be working on testing im going to test further.

 

thankyou a thousand times

Jimmy

mwegener
Most Valuable Professional
Most Valuable Professional

Hey @jimmy7377, you're welcome. 😉

Did I answer your question?
Please mark my post as solution, this will also help others.
Please give Kudos for support.

Marcus Wegener works as Full Stack Power BI Engineer at BI or DIE.
His mission is clear: "Get the most out of data, with Power BI."
twitter - LinkedIn - YouTube - website - podcast - Power BI Tutorials


Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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