cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
somwanshi Occasional Visitor
Occasional Visitor

Username() function not working

Hi Everyone,
Im trying to filter my visual with current logged in user (with out applying row level security) but it is not working. I have used following dax query for my measure.
 
New_Total Activity Count = IF(COUNTROWS(DISTINCT(ALLSELECTED('systemusers (2)'[fullname])))<COUNTROWS(DISTINCT(ALL('systemusers (2)'[fullname]))),
COUNT(activitypointers[activityid]),
CALCULATE(COUNT(activitypointers[activityid]),FILTER('systemusers (2)','systemusers (2)'[internalemailaddress]=USERNAME() )))
 
When I replace Username() function with some email Id for example "xxx@example.com" it works.
 
Kindly advice
Thank you.
1 ACCEPTED SOLUTION

Accepted Solutions
v-lid-msft Super Contributor
Super Contributor

Re: Username() function not working

Hi @somwanshi ,

 

As the Online Document, The username() function will return the format as domain\user locally, if you always want to get UPN email address format, you can use the USERPRINCIPALNAME() function.

 

Community Support Team _ DongLi
If this post helps, then please consider Accept it as the solution to help the other members find it more 

View solution in original post

1 REPLY 1
v-lid-msft Super Contributor
Super Contributor

Re: Username() function not working

Hi @somwanshi ,

 

As the Online Document, The username() function will return the format as domain\user locally, if you always want to get UPN email address format, you can use the USERPRINCIPALNAME() function.

 

Community Support Team _ DongLi
If this post helps, then please consider Accept it as the solution to help the other members find it more 

View solution in original post

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

Ask Amanda Anything Q&A

Ask Amanda Anything Q&A

Learn the answers to some of the questions asked during the Amanda Triple A event.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Users Online
Currently online: 514 members 4,054 guests
Please welcome our newest community members: