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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

passing a filter value into an API

I want to use an API to pull information on weather depending on the selected city.  Using the below as an example the user would select a city a list (or hopefully using the Filled Map visualisation) and that city name is passed into the API URL

 

http://api.weatherapi.com/v1/current.json?key=&q=[insert the city here]&aqi=no

 

Any idea how I achieve this?

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

Dynamic M query parameters can only be used in DirectQuery mode. But if you connect to the API, then a workaround is to use parameter instead of slicer for filtering.

 

First create a query parameter, then change the URL in the Advanced editor, like this.

 

winniz_1-1660122769187.png

winniz_0-1660122428967.png

 

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Anonymous
Not applicable

Thanks i'll give it a try however how do I make the list of values something that is selectable in a dashboard like you would with a slicer which shows a list of options tha you choose from?

 

Sorry if it obvious and I am missing it I am still quite new to PowerBi although I am lving it so far 🙂

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors