This topic has not yet been rated - Rate this topic

USERNAME Function (DAX)

SQL Server 2012

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

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())

Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.