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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
LangeJan
Helper I
Helper I

HTTP variable query params

Hello everyone

 

I am creating a Power BI report with data from http requests e.g.

https://api.openaq.org/v1/cities 

 

From my report I would like to be able to control Query Params so I e.g. can choose city.

https://api.openaq.org/v1/cities?city=007 

 

I can set the parameter city=007 in M ​​query but I have not been able to do this param variable.

 

M query:

 

let  

   cities_url = "https://api.openaq.org/v1/cities", //Web Url

   request_limit = "10000", //number represented by a string

   request_city = "007",

   Source = Json.Document(Web.Contents(cities_url, [Query = [city = request_city,limit = request_limit]])),

    results = Source[results],

    results1 = results{0}

in

    results1

 

 

Is it possible to make a report with variable query params?

 

Let me know if any further information is necessary

Thanks

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

Hi @LangeJan ,

Yes,you could create query parameter to change the city_id dynamically. You can refer the following documentations to achieve it.

Change the Source of Power BI Datasets Dynamically Using Power Query Parameters

Dynamic Web.Contents() and Power BI Refresh Errors

Web.Contents with dynamic file URL

 

Wish  it is helpful for you!

 

Best Regard

Lucien Wang

View solution in original post

3 REPLIES 3
v-luwang-msft
Community Support
Community Support

Hi @LangeJan ,

Yes,you could create query parameter to change the city_id dynamically. You can refer the following documentations to achieve it.

Change the Source of Power BI Datasets Dynamically Using Power Query Parameters

Dynamic Web.Contents() and Power BI Refresh Errors

Web.Contents with dynamic file URL

 

Wish  it is helpful for you!

 

Best Regard

Lucien Wang

LangeJan
Helper I
Helper I

@mahoneypat 
Thanks for your reply.

it's a great video that gives good inspiration to move on. 

I can see from the video that I can control the parameters by predefining variables in a column and including these in the Http call.
I want the user of the report to be able to enter a keyword as a parameter in the report and get the result in the report with this parameter. Do you think that is possible?

mahoneypat
Microsoft Employee
Microsoft Employee

Yes.  You can concatenate parameters and/or column values into your web calls.  Please see if this video helps.

Power BI - Tales From The Front - REST APIs - YouTube

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors