Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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.
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.
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?
This number is the part that changes in the url that I must place:
And I have a data source with those numbers here. Is there any way to take them from there?
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://community.powerbi.com/t5/Desktop/script-running-looping-URLs-and-get-data/td-p/135980/page/2
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
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.
User | Count |
---|---|
125 | |
106 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |