USERNAME DAX Function (Information) Volatile
Returns the domain name and user name of the current connection with the format of domain-name\user-name.
Syntax
This expression has no parameters.
Return values
The username from the credentials given to the system at connection time.
This function is not supported in calculated tables/columns.
» 3 related functions
Examples
-- USERNAME is the local user name (same as USERPRINCIPALNAME using -- Azure AS and Power BI Service) -- USEROBJECTID is the security identifier in Active Directory and -- Azure Active Directory -- USERPRINCIPALNAME is the user principal name, typically the user -- email (it could be different in Active Directory on-premises) EVALUATE { ( "USERNAME", USERNAME () ), ( "USEROBJECTID", USEROBJECTID () ), ( "USEPRINCIPALNAME", USERPRINCIPALNAME () ) }
Related articles
Learn more about USERNAME in the following articles:
-
Managing hierarchical organizations in Power BI security roles
This article describes how to apply dynamic security roles in a hierarchical organization to minimize the maintenance effort on the security configuration and obtain the best performance at query time. » Read more
-
Reading active Power BI security roles in DAX
This article describes how to read the active security roles in a Tabular model for Power BI or Analysis Services. This way, you can use measures and calculation groups to customize a report based dynamically on security roles active for the current user. » Read more
Related functions
Other related functions are:
Last update: Oct 27, 2024 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo
Microsoft documentation: https://docs.microsoft.com/en-us/dax/username-function-dax