Power BI Report Builder - Find User Name From Power BI Cloud

Hello All,

Using Power BI Report Builder with reports running on Power BI Cloud with a data gateway, am trying to select the user name of the user viewing the report into a parameter.

From the Built-In Fields in Power BI Report Builder have access to User ID which in Power BI Cloud defaults to the user’s email address (e.g. john.smith@corpx.com). I need to exact ideally the user’s username (e.g. CORPX\johnsmi) or if not possible the user’s full name (e.g. John Smith) and/or the user’s first name (e.g. John) and last name (e.g. Smith).

Is there a way to do this?

The only other user Built-In Field that has seen is language.

Thanks

1 Like

Personally I don’t know the direct answer to this one.

Hopefully some other members can shed some light on this one.

Sam

Hi Elliot,

I use Power BI Report Server on-prem, although our company is using Office 365 with Azure AD and deal with some similar issues, especially with SharePoint 365. I did a search online and found this blog post describing the DAX function Username(), and this article which compares Username() and UserPrincipalName().

Basically, you need to enable row-level security, even if all users have the same access. That appears to allow the user GUID to be translated into an actual user name. It appears that UserPrincipalName() is preferred over Username() because it always returns the UPN whereas Username() returns the domain account when on the desktop.

The trouble with both of these functions is that they do not provide your required human name values. The examples indicate you would have to have a separate table of users listed by UPN with the other name components in separate columns. Basically, the cloud does not know about your local domain account, and neither the cloud nor on-prem know the user’s human name unless there is a table storing those values by username which can be joined to or looked up.

John C. Pratt
Enterprise%20DNA%20Expert%20-%20Small