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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Power BI Query Parameters in the UI Report

Often, we have to link to website data via API, and we use query parameters for parts of its API.

for example, the parameter 'location' is being used in part of its API as below:

https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/{location}/2022-...

How are we able to bring this parameter 'location' to the UI report itself, such that user has a list of locations to choose from?

 

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

Hi @Anonymous,

 

Use & to combine these strings and

First, you need create a parameter named location or something you like and use this M code to do it:

let
    yourkey = "PVACBQ6LTCVBR9NBF529V3H8V",
    url = "https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/"& location &"?key="& yourkey,
    data = Json.Document( Web.Contents(url))    
in
    data

Reault:

vchenwuzmsft_1-1651806884645.png

 

Best Regards

Community Support Team _ chenwu zhu

 

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

5 REPLIES 5
v-chenwuz-msft
Community Support
Community Support

Hi @Anonymous,

 

Use & to combine these strings and

First, you need create a parameter named location or something you like and use this M code to do it:

let
    yourkey = "PVACBQ6LTCVBR9NBF529V3H8V",
    url = "https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/"& location &"?key="& yourkey,
    data = Json.Document( Web.Contents(url))    
in
    data

Reault:

vchenwuzmsft_1-1651806884645.png

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

with the code in M code, I have below error:

tan_thiam_huat_0-1653810242186.png

 

SpartaBI
Community Champion
Community Champion

@Anonymous 
It's a long answer 🙂
Check this official doc:
https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-dynamic-m-query-parameters

Anonymous
Not applicable

Thanks for the link and prompt reply, I will give it a try and let you know 🙂

I am not sure if that works for API, hopefully it works.

@Anonymous  I'm not sure also 😃

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!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

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