Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Return full username

I have a table that has the username, name among other information, I want to get the username from the pbi and cross it with this table and return the other information of this user   I want to cr...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Anonymous 

    As I mentioned before, UserName() will return Domain\Name in Power BI Desktop. UserPrincipalName() will return email format like [email protected] in Power BI Desktop.

    Both of UserName() and UserPrincipalName() will return email format to show UPN(Current user login in Power BI Service) in Power BI Service. 

    My Test:

    CurrentName = CALCULATE(MAX('Table'[Name]),FILTER('Table','Table'[Domain\Name] = [CurrentUser]))

    In Desktop, UserName() will return Domain\Name, so measure works well.

    In Service, UserName() will return a email format and measure won't work.

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.