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
pyskaty
Frequent Visitor

Row Level Security filters NULL values on relation

I'm looking for solution to my problem. I have 3 tables with data from all of my customers (multitenant):

Drivers (id, name, clientId, ... ), Vehicles (id, name, clientId, ...) and rides (Id, vehicleId, driverId, clientId, ...). 

On top of that I have build several reports and embed them in my application.

I implement row level security by clientId -> when customer displays reports in my application I filter above tabels by clientId. And everything works fine exect one scenario. 

When I have rides where driverId is null (which is completely correct from business point of view) RLS filters that rows (through driver to rides relation).

How to implement it so rows in Rides that have driverId = null won't be filtered??? 

 

Many thanks 

4 REPLIES 4
v-lili6-msft
Community Support
Community Support

hi  @pyskaty 

For your case, you could try this way as below:

I assume that this is a simple sample data, and you use [Name] for RLS

DriversDriversridesrides

for your case, add a calculated column in rides table 

Name for rls = RELATED(Drivers[Name])

Now define RLS use this new column [Name for rls] instead of [Name]

[Name for rls] = "A"||[Name for rls] =blank()

13.JPG

of course you need adjust the relationship as below:

14.JPG

Result:

16.JPG

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Tad17
Solution Sage
Solution Sage

Hey @pyskaty 

 

Easiest solution is to replace the "null' with a value or word to include in the filter.

 

If this helps please kudo.

If this solves your problem please accept it as a solution.

amitchandak
Super User
Super User

Not sure what exact condition, but can be handled like ?

if(not(isblank([driverId]),security filter)

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

The trick is that I'm not filtering Rides table by driverId, only by clientId. Rows from Rides tabel are filtered because of relation between Rides and Drivers tabel (drivers are also filtered by clientId and then applied to Rides table - where 'NULL' driver didn't exists so it filters Rides where driverId is null).

 

I'm considering creating shadow driver for every klient and insert its Id for Rides that normaly have NULLa. But maybe there is some other, simpler solution.

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.