Forum Discussion
Dynamic URL based on a measure's value as a data source
Hi,
I would like to dynamically change the number "22" in the URL below as a data source.
Json.Document(Web.Contents("https://fantasy.premierleague.com/api/entry/17122/event/22/picks/"))
I have a measure that gives me the number I need "MAX('Dim Gameweeks (events)'[Next Gameweek Number]) - 1" but I don't know if it is possible to use that value in the URL string?
Thanks,
Paul
- Anonymous1 year ago
Hi PaulTrower01 ,
Currently I'm afraid that's not possible.
You can create a parameter to replace part of the number in the URL.
Dynamic M Query Parameters allows you to bind a field to a parameter so that a single field value can be passed dynamically to the parameter.
Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn
However, this only applies to tables in Direct Query connection mode and does not apply to measures.
Instead, tables created through the Web Connector are in Import connection mode.
Therefore, you can only change the data source manually by changing the parameter values.
Best Regards,
Dengliang Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- AnonymousNot applicable
Hi PaulTrower01 ,
Currently I'm afraid that's not possible.
You can create a parameter to replace part of the number in the URL.
Dynamic M Query Parameters allows you to bind a field to a parameter so that a single field value can be passed dynamically to the parameter.
Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn
However, this only applies to tables in Direct Query connection mode and does not apply to measures.
Instead, tables created through the Web Connector are in Import connection mode.
Therefore, you can only change the data source manually by changing the parameter values.
Best Regards,
Dengliang Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.