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

Power Query M: For each Loop

Hello.

I am somehwat familar with the Power Query M Language, but need a little  help.  I am pulling some data from the Microsoft Graph API.  I want to take the data retireved from List User and create a funtion to build another query that will pull the users profile photo for each user I have pulled from List of User.  If I can Get a better understanding on how to do something similiar to a foreach loop, this could possibly help in help me with the odata.nextLink Pagination function I am currently working on.  

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Convert that list of users into a table.  Add a column to a table that calls the photo function (you will need to Base64 encode the result).

 

That's it - that's how Power Query does "For each" things.

View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

Convert that list of users into a table.  Add a column to a table that calls the photo function (you will need to Base64 encode the result).

 

That's it - that's how Power Query does "For each" things.

@lbendlin Are you referring to BinaryEncoding.Base64?

If you want to use these pictures in Power BI visuals, yes.

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.

Top Solution Authors
Top Kudoed Authors