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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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.


@ 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!:
Mastering Power BI 2nd Edition

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? 


@ 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!:
Mastering Power BI 2nd Edition

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.

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!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.