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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Hieudao
Frequent Visitor

Can I get the email of the account currently in use in Power BI custom visual?

I am developing a custom Power BI visual (TypeScript). I would like to know if there is a way for the visual to get the email of the user creating the report or any information that can identify the user? I have searched the visual's API but have not found any fields that return email information. If not, is there a way (e.g. via Power BI REST API, authentication flow or server embedding) to get the user's email when they interact with the visual? Please advise on possible solutions and the security/privacy risks involved. Thanks!

1 ACCEPTED SOLUTION

@GeraldGEmerick's answer is the simplest approach in terms of instruction. Visuals cannot access this information directly for privacy reasons. An alternative would be to use the Entra authentication API to see if you can query the MS Graph API for user info based on current token, but be aware that this is a privileged API, meaning that (a) you will need additional setup to configure an Entra application for your visual, (b) an admin tenant can turn it off and prevent your visual from using this functionality and (c) your visual has to be published in AppSource to be able to use it - it will work in the developer visual but unless your packaged visual GUID is registerd in AppSource it will not work.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




View solution in original post

5 REPLIES 5
v-pgoloju
Community Support
Community Support

Hi @Hieudao,

 

Thank you for reaching out to the Microsoft Fabric Forum Community, and special thanks to @dm-p and @GeraldGEmerick  for prompt and helpful responses.

Just following up to see if the Response provided by community members were helpful in addressing the issue. if the issue still persists Feel free to reach out if you need any further clarification or assistance.

 

Best regards,
Prasanna Kumar

 

Hi @Hieudao,

Just wanted to follow up. If the shared guidance worked for you, that’s wonderful hopefully it also helps others looking for similar answers. If there’s anything else you'd like to explore or clarify, don’t hesitate to reach out.

Thank you.

GeraldGEmerick
Super User
Super User

@Hieudao I know that there are DAX commands for this, USERPRINCIPALNAME for example but not sure about anything else.

@GeraldGEmerick's answer is the simplest approach in terms of instruction. Visuals cannot access this information directly for privacy reasons. An alternative would be to use the Entra authentication API to see if you can query the MS Graph API for user info based on current token, but be aware that this is a privileged API, meaning that (a) you will need additional setup to configure an Entra application for your visual, (b) an admin tenant can turn it off and prevent your visual from using this functionality and (c) your visual has to be published in AppSource to be able to use it - it will work in the developer visual but unless your packaged visual GUID is registerd in AppSource it will not work.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Hieudao
Frequent Visitor

Thank you for your support

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.