Hello , looking for some guidance, this would seem to be very simple seem to be overthinking it.
I have a table with some basic team information it, as follows:
team_id | team_name |
3 | rockets |
4 | astronauts |
5 | moons |
6 | planets |
Have created a function that takes the team_id and pass it to an API with a start and end date. Unforutnately, I can't just put in a range such as start=2022-06-01 and end=2023-02-01 as it only will provide the first month of data.
(teamid) =>
let
Source = Json.Document(Web.Contents("https://api.url.example",
[RelativePath="/sportsteam/" & Number.ToText(teamid) & "?start=2022-06-01" & "end=2023-02-01",
Headers=[Authorization="authgoeshere"]]))
in
Source
I have tried a few different things but can't seem to get it to work. First, I've created 2 paramaters with lists of values for each year/month combination and pass those as paramaters in the function above. It still will only bring back the first month (i.e. first row in the parameters list). I also tried creating a table with the each month in URL format to pass to the function, but it gives me the same type of response. It's not looping as one would expect.
My thought is that I need to create start/end variables like I've done but alter the above code to repeat with the next row of the paramater OR I need to change my table so it has a row for each year/month per team. Any advice is greatly appreciated.
Solved! Go to Solution.
Hi @jp23 ,
You can refer to the following documents that may be helpful to you:
Using Custom Functions in Power BI Dataflows – BI Polar (ssbipolar.com)
Dataflow Incremental update for API with Start/End... - Microsoft Power BI Community
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @jp23 ,
You can refer to the following documents that may be helpful to you:
Using Custom Functions in Power BI Dataflows – BI Polar (ssbipolar.com)
Dataflow Incremental update for API with Start/End... - Microsoft Power BI Community
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.