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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
rfolkers
New Member

New query based on other query's output

I'm pretty new to Power BI, so please bear with me.

 

Here's the thing. I have a data feed which returns an XML-feed which I can load into Power BI, this works great. The URL I use determines which data is returned, for example:

https:/url.com/api/?apikey=THISmyKEY&service=list_clients

 

The URL above returns all clients. Now here comes my challenge. The URL above outputs a table with clientname and a clientID.

I want to feed all clientID's into a new URL, which will return information about that client into a new table, so that would look something like:

 

https:/url.com/api/?apikey=THISmyKEY&service=list_devices_at_client&clientID={all clientID's from previous URL}

 

I'm pretty sure that this is doable, but since I'm inexperienced, Im hitting a wall right now, so any advice or help is welcome.

 

 

 

1 ACCEPTED SOLUTION

In your new table with client ID's in each row, add a new column where you combine your URL with the field with the client ID.

Like this:

 

=Web.Page(Web.Contents("https:/url.com/api/?apikey=THISmyKEY&service=list_devices_at_client" & [clientID]))

 

 

Where "clientID" is the name of the column with your client IDs 🙂

 

That will produce 1 API call per row and return the results (table) in each cell. You can then just expand that column.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

Well, you are probably talking a custom function here at least. In any event, what you would likely have is one query that gives you your table the way you have it now if you want that table that way. You would then copy that query and write a custom function to feed the client names to your URL and do whatever processing you want and end up with your new table. All this being said, I know that I have seen @ImkeF solve this sort of thing in other posts, so hopefully she will be along shortly to sort it all out for you.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

In your new table with client ID's in each row, add a new column where you combine your URL with the field with the client ID.

Like this:

 

=Web.Page(Web.Contents("https:/url.com/api/?apikey=THISmyKEY&service=list_devices_at_client" & [clientID]))

 

 

Where "clientID" is the name of the column with your client IDs 🙂

 

That will produce 1 API call per row and return the results (table) in each cell. You can then just expand that column.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Thank you very much for pointing me in the right direction and you where right that I should create a new column.

The formula I had to use was:

=Web.Page(Xml.Tables("https:/url.com/api/?apikey=THISmyKEY&service=list_devices_at_client" & [clientID]))

 

Thanks again, you helped me big time!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors