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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
cv77
Helper I
Helper I

Conditionally display text if row level security returns no data

Hi, 

 

We publish multiple reports to a workspaces, and users may have different row level access across the reports.  For example, a user may have access to a certain subset of the data in report1 and access to a different subset of the same data, or no data at all, in report2 within the same workspace. 

 

Is there a way that we can display something like 'No access' eg in a textbox, in the case where a user has no data available in a report, other than by modifying each measure to conditionally display something (not a desirable solution due to the number of measures and opportunity for error).  By default if the user opens a report and RLS returns no data, the absence of data is unintuitive. 

 

Thanks.

 

1 ACCEPTED SOLUTION

Hi @cv77 ,

 

There is no specific function, but the following solution can be used to solve it.

It is to count your rows. If the user can't see the data, the count is empty, and no access permission is returned.

You can create the following measure and put it into a card visual.

 

Measure = IF(ISBLANK(MAX('username'[username])),"No access","Have access")

 

Users with access can see the following

2.png

Users without access can see the following

3.png

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

7 REPLIES 7
cv77
Helper I
Helper I

Thanks for the response.  Is there a way that I can use that other than on every measure?  I was looking for something that would apply across the report rather than having to write it into every calculation.   

I am not aware of a more global approach - apart from using different reports for different audiences that avoid the issue in the first place.

Thank you.   

Hi @cv77 ,

 

There is no specific function, but the following solution can be used to solve it.

It is to count your rows. If the user can't see the data, the count is empty, and no access permission is returned.

You can create the following measure and put it into a card visual.

 

Measure = IF(ISBLANK(MAX('username'[username])),"No access","Have access")

 

Users with access can see the following

2.png

Users without access can see the following

3.png

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

For some reason, I cannot seem to get this to work on the Power Bi Report Server. 😞

It works fine on the Desktop app when I use the preview using, Modeling>View as.
But as soon as the file gets uploaded, people with no acess only sees a big X if I put the measure on a Text box or the Loading icon on a Card, instead of the "No Access." text.

marksn_2-1689930714012.png

 


Funny thing is, RLS seems to work just fine. Only people with Access are able to see the data.
I just wanted to have a text that says "No Access" for users without access. And such measure seems to fail.

Any advice?

 

 

Thank you Stephen.  I did end up doing something like this.  I appreciate your response.

lbendlin
Super User
Super User

while the absence of data may be unintuitive, the message "No access" is like a slap in the face, and likely to decrease your friend count. 

 

You can use COALESCE to cover the "missing data"  scenario.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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