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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.