Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
USERNAME Function

USERNAME Function (DAX)

 

Returns the domain name and username from the credentials given to the system at connection time

USERNAME()

The username from the credentials given to the system at connection time

Exception Condition

Under Windows authentication, the returned string has the structure: <domain-name>\<user-name> 

The following code verifies if the user login is part of the UsersTable.

=IF(CONTAINS(UsersTable,UsersTable[login], USERNAME()), "Allowed", BLANK())

Community Additions

ADD
Show:
© 2015 Microsoft