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
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

@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
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.