Cheat Sheets/Power BI/USERNAME
DAX function

USERNAME — DAX function reference

Current user (domain\user).

Syntax

dax
USERNAME()

Examples

dax
USERNAME()
→ A user string
dax
"Report viewed by: " & USERNAME()
→ A debug/audit text box showing who is viewing

Matches the legacy domain\user format, more common on-premises with Analysis Services than in the Power BI Service.

dax
IF(USERNAME() = "CONTOSO\\jdoe", TRUE(), FALSE())
→ true / false

Common mistakes & gotchas

Related DAX functions

From Security & context info

← Back to the Power BI (DAX) cheat sheet