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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Getting photo from Azure Active Directory to Power BI/Query

Hi!

 

I am trying to get data from Azure Active Directory to Power BI Desktop. I though that would be easy through the Active Directory Connector. But that wasn't easy. After spending to much time on that I come over using Azure AD Graph in stead. That seems to work and the graph explorer was helpful. 

https://graph.windows.net/{mytenant.Onmicrosoft.com}/users?api-version=1.6 gave me all users data. See code below. Take note of the field thumbnailPhoto@odata.mediaEditLink, it is a part of link to the picture. Adding https://graph.windows.net/{mytenant.Onmicrosoft.com}/ before this text we got a correct address to the picture. Then I though I could create this code below to get the picture perhaps as Base64 binary code, and hopefully could add this field in a chiclet slicer component or something to show the picture. The code below gave me an error

 

DataFormat.Error: We found extra characters at the end of JSON input.
Details:
Value=
Position=0

 

Perhaps it is a better way to get photos on power bi service/office365, but if any of you have a clue what is wrong and how to correct this I would be grateful

 

Regards Geir

 

 

let

    Source = Json.Document(Web.Contents("https://graph.windows.net/mytenant.OnMicrosoft.com/directoryObjects/af894aa1-9fad-4400-818b-580c7258a115/Microsoft.DirectoryServices.User/thumbnailPhoto?api-version=1.6")),
       value = Source[value],
    ConvertedtoTable = Table.FromList(value, Splitter.SplitByNothing(), null, null, ExtraValues.Error)
 
    in

    ConvertedtoTable

 

1 REPLY 1
dax
Community Support
Community Support

Hi geirf,

If you want to add image to powerbi  from AAD, you could try to refer to Add Photos to Power BI from Active Directory for details.

Best Regards,
Zoe Zhi

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

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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