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
jp23
Frequent Visitor

Dataflow Working with Start and End Date for API with Custom Function

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_idteam_name
3rockets
4astronauts
5moons
6planets

 

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.

 

 

1 ACCEPTED SOLUTION
v-tangjie-msft
Community Support
Community Support

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. 

View solution in original post

1 REPLY 1
v-tangjie-msft
Community Support
Community Support

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. 

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.

Top Solution Authors
Top Kudoed Authors