Forum Discussion
Conditionally display text if row level security returns no data
- Anonymous4 years ago
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
Users without access can see the following
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.
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.
- Anonymous4 years agoNot applicable
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
Users without access can see the following
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.
- cv774 years agoHelper I
Thank you Stephen. I did end up doing something like this. I appreciate your response.
- marksn3 years agoFrequent Visitor
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.
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?