Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet 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
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,
Solved! Go to 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.
@Asalk , refer if this can help
https://radacad.com/add-photos-to-power-bi-from-active-directory
@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 😁
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.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
92 | |
83 | |
71 | |
49 |
User | Count |
---|---|
143 | |
120 | |
110 | |
59 | |
57 |