Forum Discussion
How to apply RLS and show blanks in table for specific measure?
- 3 years ago
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.
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)
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.