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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
girlwonder
New Member

Passing slicer selection to REST API call in power query

I have this slicer.

 

I want the end user to select a Currency Code from the slicer and then use that Currency Code in a REST API call in Power Query?

 

How do I add the Currency Code selected in this slicer to the end of this API call?

 

https://api.website.com/v2/exchange-rates?currency= ???

 

dim currencies.png

 

 

let
       exchange_rates_url = "https://api.website.com/v2/exchange-rates?currency={Currency Code}", //Web Url
   request_limit = "10000", //number represented by a string
   Source = Json.Document(Web.Contents(exchange_rates_url, [Query = [limit = request_limit]])),
    // number represented by a string
    data = Source[data],
    // number represented by a string
    rates = data[rates],
    #"Converted to Table" = Record.ToTable(rates)
in
    #"Converted to Table"

 

 

2 ACCEPTED SOLUTIONS
lbendlin
Super User
Super User

Dynamic M Query Parameters only work with Direct Query data sources.  Your API isn't one.

View solution in original post

Anonymous
Not applicable

Hi @girlwonder 

As the @lbendlin  mentioned, if you want to use the dynmaic paramater, you need to make sure that your connection mode is direct query, such as SQL database and so on, they can be connected by Power BI Desktop with direct mode, You can refer to the following link about the dynamic paramater.

https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-dynamic-m-query-parameters#prerequis...

If you want to change the paramater with the import mode, it only can be changed in power query or In data source settings in Power BI Service, You can refer to the following link.

https://learn.microsoft.com/en-us/power-bi/connect-data/service-parameters#review-and-edit-parameter...

You can change the data source to the ones that support direct query mode. such as :

  • SQL Server
  • Azure SQL Database
  • Azure Synapse Analytics (formerly SQL Data Warehouse)
  • Oracle
  • Teradata
  • SAP HANA

 

Best Regards!

Yolo 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

2 REPLIES 2
Anonymous
Not applicable

Hi @girlwonder 

As the @lbendlin  mentioned, if you want to use the dynmaic paramater, you need to make sure that your connection mode is direct query, such as SQL database and so on, they can be connected by Power BI Desktop with direct mode, You can refer to the following link about the dynamic paramater.

https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-dynamic-m-query-parameters#prerequis...

If you want to change the paramater with the import mode, it only can be changed in power query or In data source settings in Power BI Service, You can refer to the following link.

https://learn.microsoft.com/en-us/power-bi/connect-data/service-parameters#review-and-edit-parameter...

You can change the data source to the ones that support direct query mode. such as :

  • SQL Server
  • Azure SQL Database
  • Azure Synapse Analytics (formerly SQL Data Warehouse)
  • Oracle
  • Teradata
  • SAP HANA

 

Best Regards!

Yolo Zhu

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

 

lbendlin
Super User
Super User

Dynamic M Query Parameters only work with Direct Query data sources.  Your API isn't one.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.