Forum Discussion
Power BI embedded report - USERNAME() function returns service principal id instead of username
I know this is years later, but did you ever find a resolution? Experiencing a similar problem.
Hi renatalamb
Indeed it was quite long ago 🙂 We have finally raised a ticket with the support and in the end the feedback was that "when the Measure is created in the Proxy dataset and not in the core dataset , it is expected by design that in the proxy dataset the username() function will return the Service Principal object ID.
Since the measure was created in the proxy dataset and not in the core dataset then the behaviour is as expected. For the proxy dataset the user was not overriding the effective identity, and this is why they were seeing the Service Principal's App ID as the effective identity."
Unfortunately I do not remember if that solution was helpful, cause in the end we refrained from using the mixed model dataset due to performace reasons.
Best regards
Andrzej