USERNAME

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

Syntax

USERNAME ( )

Parameters

Return value

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

Example

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

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

***** Related Blog Posts *****
60 Page DAX Formula Reference Guide Download Now Available
Show Only Top Or Bottom Results Using Ranking Formula Techniques – Power BI & DAX

***** Related Course Modules *****
Ultimate Beginners Guide to DAX
Mastering DAX Calculations
Solving Analytical Scenarios w/ Power BI and DAX
DAX Formula Deep Dives
Advanced DAX Combinations

***** Related Video Tutorials *****
Ultimate Beginners Guide to DAX

What Is DAX? & Why Do You Need To Learn It – (1.2) Ultimate Beginner Guide to DAX
Formula Syntax, Comments & Variables – (1.6) Ultimate Beginners Guide to DAX
Examples Of Advanced DAX – (1.18) Ultimate Beginners Guide to DAX

***** Related Support Forum Posts*****
Mastering DAX Calculations: What Is DAX?
Understanding DAX Formula
Developing Complex Dax functions
Power BI Report Builder – Find User Name From Power BI Cloud
Dynamic Row Level Security w/ Multiple Criteria
Row Level Security