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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
nandukrishnavs
Super User
Super User

USERPRINCIPALNAME() returning wrong email id in Power BI service

Hi All

 

I have created a simple measure and showing this measure in a card visual.

 

 

emailid = USERPRINCIPALNAME()

 

 

 I tried to change the user using Test as role from RLS window.

nandukrishnavs_0-1597171260285.png

For some users, the card visual is showing the correct email id. Few users it is showing the wrong email id.

below is correct

nandukrishnavs_2-1597171498818.png

below is wrong

nandukrishnavs_1-1597171395854.png

Note: InternalControl is my email id.

 

I tried to check the same in Power BI desktop and it is working as expected. Is anyone know what is the issue?

 

CC: @Greg_Deckler  @parry2k @amitchandak 

 

 


Regards,
Nandu Krishna

5 REPLIES 5
thebigwhite
Helper II
Helper II

I am facing exactly the same issue. 25/08/2023 I think this is a general bug

JensEggerath
Regular Visitor

Hi @v-xicai , 

 

I have exactly this problem in one of my workspaces. It only happens if someone is or had been member, admin or contributor on the given workspace, which would exempt them from standard RLS. Then, even if I remove the user from the workspace completely (only leaving report+dataset+RLS viewer rights), my own UPN is shown instead of theirs when using "view as role".

In my case, when the users log in themselves, RLS just seems to work as expected. It's only a problem when simulating access for someone else. I guess it either caches or queries historic contributor/member/admin roles when determining the access rights.

 

Best regards,

Jens

parry2k
Super User
Super User

@nandukrishnavs not fully sure how you are testing it? Did your user logged in and get different UPN or you are getting wrong when using Test As Role.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi @parry2k

 

Actually my user has reported RLS not working. To identify the root cause, created a simple measure and tested above scenario myself. I'm getting wrong UPN when using Test As Role.

 

I am assuming, this could be the reason why RLS was not working properly. 


Regards,
Nandu Krishna

Hi @nandukrishnavs ,

 

Have the issue been resolved? If Yes, could you please show us the solution to help others having the similar issue and accept it as the solution ? We will appreciate you so much.

 

You may refer to the article Row-Level Security (RLS) to manage roles,  please see the link Power BI Desktop Dynamic security cheat sheet, which described the detailed steps. Maybe it doesn't work, there are some tips to let it work and test it efficiently.

 

Best Regards,

Amy 

 

Community Support Team _ Amy

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.