Forum Discussion
USERPRINCIPANAME() returning the same for all users.
We are trying to implement RLS to a dashboard which source is SQL Analysis Services.
When using USERPRINCIPALNAME() on desktop I get my UPN, but when I publish the report to Online Services it returns an UPN which is the same for every user viewing it. which looks like Server's username.
How can I get the user's UPN also when I publish the report online? In Power BI Report server there was a way to Impersonate the user viewing the report, but I am not able to find it in Online Services.
2 Replies
- ibarrauSuper User
Hi. I haven't tried this but I pretty sure the USERPRINCIPALNAME() should be on Analysis Services and not in desktop. Now SSAS is the owner of the dataset, so you should keep roles and dax in there.
You can follow this guide to be sure you are doing all necessary steps:
https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-tutorial-row-level-security-onprem-ssas-tabular(Step 2 is creating the RLS in SSAS)
I hope that helps,
- magjiHelper I
Yes, the Row level security is set in SSAS. But the Power BI somehow is not recognizing the user's UPN.