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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cgaralde
Frequent Visitor

Row Level Security works on Desktop but not on Server Portal

HI,

 

I have recently configured our on-prem report server, created some reports and TRIED applying RLS on the same reports unsuccessfully.  RLS does work when I try VIEW AS on the desktop app but when I deploy it on the portal and run the report, the values are just blank.

 

Here is the premise:

I have the following table to control access to certain data called, ACCESS CONTROL.

 

User                             | Company               | Store

DOMAIN\user.name    | MyCompany 1            | MyStore 1

DOMAIN\user.name2  | MyCompany 1            | MyStore 2

 

I have also setup a measure to check for the current user,

 

User2 = USERNAME()
 
And then I created Role on the desktop app called, PERMISSIONS.
That is filtering on the ACCESS CONTROL table using the following
 
[User] = [User2]
cgaralde_2-1671002672216.png

 

Finally, I added two slicers, one to show Company and the other to show Store. If I try this setup on the desktop app using VIEW AS, i get my SLICERS filtered correctly.
 
cgaralde_3-1671002755093.pngcgaralde_4-1671002799964.png
 
I uploaded the report on the portal and ran it only to be greeted with access errors on all visuals.  I, then, added the user on the report with the same role as PERMISSIONS and when I ran the report again I can see all reports but the SLICERS are blank.
 
cgaralde_5-1671002966225.pngcgaralde_6-1671003016186.png

 

So, in the end did I miss something which is why me slicer is not showing correctly.  I would appreciate all input regarding this matter.

 

 

 

 

 

1 ACCEPTED SOLUTION
cgaralde
Frequent Visitor

I finally found the issue and corrected it and it finally works.

 

First of all, this DAX website, https://dax.guide/username/ states that USERNAME() returns DOMAIN\username and based on this my table checks for DOMAIN\username.  Now, I have added a CARD VISUAL on my report to show USERNAME() and lo and behold, on the desktop app,  it shows DOMAIN\username but on the portal it shows username@DOMAIN.COM.

 

Thanks @alosada for all you inputs.  Surely your replies guided me in the right direction.

View solution in original post

8 REPLIES 8
cgaralde
Frequent Visitor

I finally found the issue and corrected it and it finally works.

 

First of all, this DAX website, https://dax.guide/username/ states that USERNAME() returns DOMAIN\username and based on this my table checks for DOMAIN\username.  Now, I have added a CARD VISUAL on my report to show USERNAME() and lo and behold, on the desktop app,  it shows DOMAIN\username but on the portal it shows username@DOMAIN.COM.

 

Thanks @alosada for all you inputs.  Surely your replies guided me in the right direction.

alosada
Frequent Visitor

hi!

 

When using dynamic RLS by username() you should apply this RLS in Power BI Desktop as follows:

 

alosada_1-1671007648201.png

- Select other user option as well, and enter the desired email.

There you will see if the RLS is really doing it's job.

 

What I also recommend you is to use directly the USERNAME() function in the role DAX expression.

 

 

 

@alosadaThanks for your input. 🙂

I have done this earlier and RLS still works on the desktop if I select both OTHER USER and PERMISSIONS. 😞

And that happens to you or the user you are trying to apply RLS?

I have setup two users and both appear correctly in the desktop app when i enter the user as DOMAIN\user.name in OTHER USER.

And on the portal that happens to all users or only you?

 

Have you trying deleting the dahsboard from the portal and reuploading it? (not rewriting)

I prayed so hard hoping that this is the soultion but alas, I deleted the report, reuplaoded it and then I configured the permissions in the report server and I still did not get any data on my slicer. 😞

Try to set up the Row Level Security property of your report. In my example below I selected the role "Authorizer" then added the members who will access the report

AlainJimenez_0-1705940672493.png

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors