cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Jannis68 Frequent Visitor
Frequent Visitor

importing dynamic json file

Hi, 

 

I am a keen player of fantasy Premier League, and are looking for a way to load team-picks for the players in my private league. The link below shows the structure of the link:

 

https://fantasy.premierleague.com/drf/entry/722115/event/1/picks

 

  • 722115 = my team_id
  • 1 = round number

 

I am looking for a simple M script that can update a flat table based on a table of team_ids and round_numbers. Furhtermore, the array of round number should be within the range of 1 and last round played (can be a parameter). Below is a copy of the current Advanced Editor:

 

 

 picks.gif

 

 

best,

Jan Nylund

 

 

 

5 REPLIES 5
Moderator v-yuezhe-msft
Moderator

Re: importing dynamic json file

@Jannis68,

Please check parameters in the query editor of attached PBIX file.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Jannis68 Frequent Visitor
Frequent Visitor

Re: importing dynamic json file

Hi,

 

a good start. I looking for a way to update my table with all rounds played and all players in my league. Both players and rounds could be in separate tables. If I had performed this in Python, I would have used a look. Is there a similar function here?

 

best,

Jan

 

 

Moderator v-yuezhe-msft
Moderator

Re: importing dynamic json file

@Jannis68

Yes. You can choose "Query" when creating parameters. For more details, please review this similar thread:https://community.powerbi.com/t5/Desktop/Using-a-table-column-as-a-list-of-values-for-a-parameter/td....

1.PNG


Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Jannis68 Frequent Visitor
Frequent Visitor

Re: importing dynamic json file

Hi,

 

still not there, as far as I can see you only end up with the picks for one player for one round. What I am looking for is a smooth way to open the follwoing links (and to add rounds automatically ):

 

https://fantasy.premierleague.com/drf/entry/722115/event/1/picks

https://fantasy.premierleague.com/drf/entry/7707/event/1/picks

https://fantasy.premierleague.com/drf/entry/722115/event/2/picks

https://fantasy.premierleague.com/drf/entry/7707/event/2/picks

.....

Both Player and Round could be a list, my question is how to merge these lists into 

 

best,

Jan

 

Moderator v-yuezhe-msft
Moderator

Re: importing dynamic json file

@Jannis68,

What do you mean merge lists? In your scenario, you would need to create two parameters , one for team id, one for round, and you should choose "Query" as suggested value when creating these parameters.

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 136 members 1,835 guests
Please welcome our newest community members: