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
jracer007
Helper IV
Helper IV

Add multiple data sources in PowerQuery

Hello,

As I can add several sources of JSON data to Power Query, they are the same url only the code (11500475788) is the one that changes. The idea is to take all the sources without having to create them one by one.

power bi10.png

14 REPLIES 14
Greg_Deckler
Super User
Super User

Sure, just add additional Source lines, just make sure they are named uniquely, Source1, Source2, Source3, etc. I do this all the time when creating Merge and Append queries.



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Could I take the url from a column from another data source? They are more than 300 sources and are constantly growing.

Not sure I understand your question. Can you clarify? 



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

This number is the part that changes in the url that I must place:
Opera Instantánea_2018-01-22_103757_community.powerbi.com.png
And I have a data source with those numbers here. Is there any way to take them from there?
power bi11.png

The first and third links are very similar to what I need.

ImkeF
Community Champion
Community Champion

You have to perform the following steps:

1) Transform your query into a function that takes the id as a parameter

2) Add new column to your data-source table where you call that function and pass the reference to your ID-column [ID] as the parameter.

 

You can find a detailled explanation of how this works here for example: http://blog.pragmaticworks.com/power-query-controlling-m-query-functions-with-user-driven-parameters

 

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

It's a little different from what I'm looking for.

ImkeF
Community Champion
Community Champion

How?

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

ImkeF
Community Champion
Community Champion

Maybe this video helps you to see the parallels: https://www.youtube.com/watch?v=RXm1MoxD1UA

This is a very good blogpost showing how to integrate parameters into URLs like in your example: http://satalyst.com/power-query-creating-a-parameterized-function-in-m/

 

Turn your query into a function like this:

 

(MyParameter as text) =>
Source = "xxxxx/articles/"&MyParameter&"/votes.json",Continue your query.

 

For the future, please paste your query code so that we can adjust it without having to re-type it, thanks.

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

ImkeF
Community Champion
Community Champion

No

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

power bi10.png
For example "https://tigoco.zendesk.com/api/v2/help_center/articles/115004757788/votes.json"
                     "https://tigoco.zendesk.com/api/v2/help_center/articles/300008655255/votes.json"
                     "https://tigoco.zendesk.com/api/v2/help_center/articles/396235888125/votes.json"


Got it. Who you need to talk to is @MarcelBeug and @ImkeF as I believe they have previously answered very similar questions around looping through a set of URL's. I would expect that they will be along shortly now that I have mentioned them in this thread.



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

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.