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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Asalk
Frequent Visitor

How to Add Employee Profile Picture from Office 365 (Teams, Outlook..etc) to Report?

Hello,

I'm trying to retrieve/embed employee profile picture from Office 365 inside a Power BI report. I tried all the methods mentioned previously in the community but to no avail. I know PowerApps has a O365 connector, but I couldn't find anything similar in Power BI. And when adding pictures from Azure AD the pictures are cropped (not showing correctly) as i'm assuming some of them are exceeding the 32K character limit. 

Should I go with a PowerApp based solution for this problem? Did any of you succeed in importing employee profile pictures from Azure AD?


Best,


1 ACCEPTED SOLUTION

Hi @Asalk,

 

If you can use binary data in Power Query to embed images in Power BI reports, then you need to consider the maximum string length limit allocated in Power BI for string length.

We know that we can't store Base64 characters (Text representation of the image) more than 32,677 characters, so as a workaround, we have to store this information in multiple rows and chunks. Each of the cells will have less than 32,677 characters, and at last, we will reassemble these cells into a single DAX measure. The idea is to remove the text limitation using the DAX measure.

This blog post shares an intuitive way to embed images with complete original size. Please see: COMPLETE GUIDE TO EMBED IMAGES IN POWER BI REPORTS 

 

 

Also you may try to use Power Apps to meet this:

You can use Office 365 users connector, and enter the formula:

If(Office365Users.UserPhotoMetadata(ThisItem.Id).HasPhoto=true,Office365Users.UserPhoto(ThisItem.Id),SampleImage)

(ID generally refers to a person's email address, If there is no avatar, the sample image is the default image.)

For more information, you can refer to the video :PowerApps - Display Office 365 User Profile Picture

 

Hope it helps,

 

Caitlyn Yan

 

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

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@Asalk , refer if this can help

https://radacad.com/add-photos-to-power-bi-from-active-directory

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

@amaitchandak, thank you but this solution does not work as the pictures stored there are not showing correctly. I think because binary to base64 size limitation but i'm not sure.

Do you have any other solution?

Thank you!

Hi @Asalk,

 

If you can use binary data in Power Query to embed images in Power BI reports, then you need to consider the maximum string length limit allocated in Power BI for string length.

We know that we can't store Base64 characters (Text representation of the image) more than 32,677 characters, so as a workaround, we have to store this information in multiple rows and chunks. Each of the cells will have less than 32,677 characters, and at last, we will reassemble these cells into a single DAX measure. The idea is to remove the text limitation using the DAX measure.

This blog post shares an intuitive way to embed images with complete original size. Please see: COMPLETE GUIDE TO EMBED IMAGES IN POWER BI REPORTS 

 

 

Also you may try to use Power Apps to meet this:

You can use Office 365 users connector, and enter the formula:

If(Office365Users.UserPhotoMetadata(ThisItem.Id).HasPhoto=true,Office365Users.UserPhoto(ThisItem.Id),SampleImage)

(ID generally refers to a person's email address, If there is no avatar, the sample image is the default image.)

For more information, you can refer to the video :PowerApps - Display Office 365 User Profile Picture

 

Hope it helps,

 

Caitlyn Yan

 

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

Thank you so much! it worked perfectly :).

Hi Asalk. How did you get this employee profile picture?

 

I've tried different methods but I couldn't get these pictures. Using Active Directory in Power BI, pictures are diferent from Azure Active Directory (Microsoft Entra).
I'll be greatfull if you can share how to get it 😁

Asalk
Frequent Visitor

Hi,

I honestly don't remember exactly, but I do remember we ended up saving the pictures somewhere on the server and using Base64 to png. I think that was the only solution we came up with. 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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