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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
DeBIe
Post Partisan
Post Partisan

How to apply RLS and show blanks in table for specific measure?

Hi all,

 

I would like to return blank values or the value 0, based on the RLS role. Because some users are not allowed to see the processing time. I will explain the tables that are in my model and their relations. As well I will show the table how it looks like now and how I would like it to be. Any help is much appreciated!

 

I have 3 tables.

- Lookup Company

- Fact [Documents]

- Fact [ProcessingTime]

 

Relations:

(Company) 1 - * (Documents)

(Documents) 1 - 1 (ProcessingTime)

 

Now

CompanyTotal DocumentsDocumentsProcessingTime
Apple1002d
Google3001d

 

What I tried to do is add the column [HasAccess]=1 to the (ProcessingTime) table. I created two RLS roles. One with [HasAccess]=1 and the other with [HasAccess]=0. The problem when applying the RLS role with [HasAccess]=0, is that my (Documents) table will be filtered and will show no results anymore in the table. Then this will happen:

CompanyTotal DocumentsDocumentsProcessingTime
Apple Blank
Google Blank

 

The desired end result that i'm looking for is this (when RLS is applied for user that are not allowed to see the processing time)

CompanyTotal DocumentsDocumentsProcessingTime
Apple1000 (or Blank)
Google3000 (or Blank)

 

1 ACCEPTED SOLUTION
DeBIe
Post Partisan
Post Partisan

I've solved my issue by implementing Object Level Security and field parameters. This will remove the entire column which should not be visible for some users, but the table will not be broken.

View solution in original post

4 REPLIES 4
DeBIe
Post Partisan
Post Partisan

I've solved my issue by implementing Object Level Security and field parameters. This will remove the entire column which should not be visible for some users, but the table will not be broken.

DeBIe
Post Partisan
Post Partisan

@AmiraBedh  I've uploaded an example pbix. file. If you select the role Viewer, then you will see what I mean. My desired result is that I will see blank values for the column ProcessingTime when I select the viewer role. 

 

https://we.tl/t-nmImBERdCM 

 

Thanks again

AmiraBedh
Super User
Super User

Try to create a measure : 
Processed Time = IF(HASONEVALUE('ProcessingTime'[HasAccess]), 'ProcessingTime'[DocumentsProcessingTime], BLANK())

It will check if there is only one value for the 'ProcessingTime'[HasAccess] column which is determined by the RLS role, and if so, it returns the 'ProcessingTime'[DocumentsProcessingTime] value. Otherwise, it returns blank.

 

Then use it in your visual instead of directly referencing the 'ProcessingTime'[DocumentsProcessingTime] column.

 

And try to update the "Processed Time" measure to display 0 instead of blank:

Processed Time = IF(HASONEVALUE('ProcessingTime'[HasAccess]), 'ProcessingTime'[DocumentsProcessingTime], 0)

 


Proud to be a Power BI Super User !

Microsoft Community : https://docs.microsoft.com/en-us/users/AmiraBedhiafi
Linkedin : https://www.linkedin.com/in/amira-bedhiafi/
StackOverflow : https://stackoverflow.com/users/9517769/amira-bedhiafi
C-Sharp Corner : https://www.c-sharpcorner.com/members/amira-bedhiafi
Power BI Community :https://community.powerbi.com/t5/user/viewprofilepage/user-id/332696

Hi @AmiraBedh ,

 

Thank you for your suggested solution. I have a question before I can try your formula.

 

My [Documents] Table contains more documents then in the related table [ProcessingTime] table. When I apply the RLS-Role (HasAccess=1), then the total count of my [Documents] table will be limited/filtered to the total that are found in the [ProcessingTime] table. I need to be able to find a solution for this first. Am I using this correctly? Please help.

 

Thanks so much already for your time.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors