Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Rjesak
Helper I
Helper I

Display User Information on reports/dashboards

We have a table which includes user specific info (name, email address, location, etc.). I'd like for our reports and dashboards to show the user name and location. I have a report where I'm brought in the user info table and, of course, I can use USERPRINCIPALNAME to get the email address but is there any way to bind the USERPRINCIPALNAME to the email address in my user info table so that I can pull back the logged in user's name and location on the report/dashboard?

 

Here is an idea of what the shared_access table has in it:

USER NAMEUSER EMAILUSER LOCATION
Joe BlowJoe.Blow@gmail.comKansas City Office
Sue HueSusan.Hue@gmail.comWashington Office
Patty HattyPatricia.Hatty@gmail.comBuffalo Office
Johnny JohnsonJohn.Johnson@gmail.comAtlanta Office
BZ BeezBertrice.Beez@gmail.comDenver Office

 

I have imported the whole table into my report.

 

What I want to do is something like

WHEN (USERPRINCIPALNAME = shared_access.user_email THEN show shared_access.user_location

 

So, if PRINCIPALNAME = Bertrice.Beez@gmail.com THEN user_location card would show Denver Office.

1 ACCEPTED SOLUTION
vanessafvg
Super User
Super User

you could do something like this, create a measure ;

 

User Location=
var curruser = USERPRINCIPALNAME()
return
CALCULATE(VALUES(shared_access[USER LOCATION]), FILTER(shared_access, curruser = shared_access[USER EMAIL] ))




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




View solution in original post

5 REPLIES 5
Rjesak
Helper I
Helper I

That worked perfectly. Thanks so much.

vanessafvg
Super User
Super User

you could do something like this, create a measure ;

 

User Location=
var curruser = USERPRINCIPALNAME()
return
CALCULATE(VALUES(shared_access[USER LOCATION]), FILTER(shared_access, curruser = shared_access[USER EMAIL] ))




If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




So when I try to put this in a visual, I get an error that says "A table of multiple values was supplied where a single value was expected."

vanessafvg
Super User
Super User

can you provide some data or sample data, and then can you demonstrate exactly via dummy example of what you wanting to end up with.

 

 





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




I'm so sorry! I updated the post to include this. I had a little trouble getting this post in (it kept not submitting it for some reason) so I had copied and pasted my message. I didn't notice that I had failed to include my sample in my copy. Thank you!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors