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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
wkeicher
Helper III
Helper III

Passing two Parameters into WEB API (Dates) & (ID)

I need help in passing a date and a range of assoicated ID's from a table into API Calls in a looping fashion. 

  • Date = Today-1 (need this to be flxible - maybe today - 7) - Comes from a table called SportsIOSlates[Dates]
  • Associated IDs to that date -  are then treated as a list that correspond to that date (i.e filtered), then pass that list of Ids and the dat into the following API structure. The list of ID's come from a table called SportsIOSlates[PlayerID]
  • Output will be a table of ID's and assocaited fields from the API

The below is based on using that API call in a singular fashion.

let
Source = Json.Document(Web.Contents("https://api.sportsdata.io/v3/nba/projections/json/PlayerGameProjectionStatsByPlayer/2020-01-07/20001573?key=MYKEY")),
#"Converted to Table" = Record.ToTable(Source),
#"Pivoted Column" = Table.Pivot(#"Converted to Table", List.Distinct(#"Converted to Table"[Name]), "Name", "Value")
in
#"Pivoted Column"

 

 Thank you

2 REPLIES 2
v-diye-msft
Community Support
Community Support

Hi @wkeicher 

 

kindly refer to this similar thread:

https://community.powerbi.com/t5/Desktop/How-to-create-parameter-for-dynamic-date-parameter-in-json-... 

 

Community Support Team _ Dina Ye
If this post helps, then please consider Accept it as the solution to help the other members find it more
quickly.
amitchandak
Super User
Super User

@wkeicher 

Refer, if this can help

https://radacad.com/category/power-bi-rest-api

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.