cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Super User IV
Super User IV

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.


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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? 


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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

Here are some links that might get you there:

 

https://community.powerbi.com/t5/Desktop/script-running-looping-URLs-and-get-data/td-p/135980

 

https://social.technet.microsoft.com/Forums/en-US/0f9fec02-4469-4c56-92ec-00d46b26b3fc/how-to-automa...

 

https://community.powerbi.com/t5/Desktop/script-running-looping-URLs-and-get-data/td-p/135980/page/2

 

 


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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

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.

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

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

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.


---------------------------------------

@ me in replies or I'll lose your thread!!!

I have a NEW book! 
DAX Cookbook from Packt
Over 120 DAX Recipes!




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
secondImage

Happy New Year from Power BI

This is a must watch for a message from Power BI!

December Update

Check it Out!

Click here to read more about the December 2020 Updates!

Community Blog

Check it Out!

Click here to read the latest blog and learn more about contributing to the Power BI blog!

Get Ready for Power BI Dev Camp

Get Ready for Power BI Dev Camp

Mark your calendars and join us for our next Power BI Dev Camp!.

Top Solution Authors
Top Kudoed Authors