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

View all the Fabric Data Days sessions on demand. View schedule

Reply
Lars-6
Regular Visitor

Change parameter with slicer

Hi everyone, 

 

I have a parameter, that has an invoice id in it. 

Lars6_0-1745243721317.png

 

I want to change this number with a slicer. I have made a column in a table with these invoice numbers (which I changed to type text) so that I can search in the slicer. it looks something like this:

Lars6_1-1745243865027.png

 

but what I want now is that when you change the slicer to for example "2025033" the parameter also changes to 2025033. 

how can I make this? 

 

3 ACCEPTED SOLUTIONS
Deku
Super User
Super User

Dynamic M parameter. Only works with direct query. Would avoid unless very good reason to use them


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

adudani
Super User
Super User

hi @Lars-6 ,
thank you @Deku  for your insights, which I agree with.

 

Additionally, some sample implementations:

1. Dynamic Power BI reports using Parameters - YouTube

2.Revisiting a Power BI solution with Dynamic M Parameters - YouTube

3. Lastly, you could take look at populating the list from a query to get all requried ids: Populate a Power BI parameter list using a query

 

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

View solution in original post

v-pgoloju
Community Support
Community Support

Hi @Lars-6,

Thank you for reaching out to the Microsoft Fabric Forum Community.

 

A special thanks to @Deku and @adudani  for the quick and helpful response.

 

To dynamically retrieve data from an API in Power BI based on an input parameter, you can create a parameter and use it in the API URL within Power Query. Start by navigating to Home -> Manage Parameters -> New Parameter in Power BI Desktop. Name the parameter (e.g., InvoiceID), choose its data type (such as Text or Number), and either define a list of values or set it to "Any value" if you want more flexibility. Next, open Transform Data to launch Power Query, and create a new query that incorporates the parameter into your API URL. For example, the M code would look like this:

let
InvoiceID = Parameter, // this is the parameter you've created
Source = Json.Document(Web.Contents("https://your-api-endpoint.com/data?invoice_id=" & Text.From(InvoiceID)))
in
Source


After setting this up, click Close & Apply to load the data into your Power BI model using the dynamically constructed URL.

 

If you found this response helpful, please consider marking it as the accepted solution and giving it a thumbs-up to help others in the community.

 

Thank you & regards,
Prasanna Kumar

View solution in original post

7 REPLIES 7
v-pgoloju
Community Support
Community Support

Hi @Lars-6,

 

Just a gentle reminder — has your issue been resolved? If so, we’d be grateful if you could mark the solution that worked as Accepted Solution, or feel free to share your own if you found a different fix.

This not only closes the loop on your query but also helps others in the community solve similar issues faster.

Thank you for your time and feedback!

 

Best,

Prasanna Kumar

v-pgoloju
Community Support
Community Support

Hi @Lars-6,

 

We wanted to kindly check in to see if everything is working as expected after trying the suggested solution. If there’s anything else we can assist with, please don’t hesitate to ask.

If the issue is resolved, we’d appreciate it if you could mark the helpful reply as Accepted Solution — it helps others who might face a similar issue.

 

Warm regards,

Prasanna Kumar

v-pgoloju
Community Support
Community Support

Hi @Lars-6,

 

Just following up to see if the solution provided was helpful in resolving your issue. Please feel free to let us know if you need any further assistance.

If the response addressed your query, kindly mark it as Accepted Solution and click Yes if you found it helpful — this will benefit others in the community as well.

 

Best regards,

Prasanna Kumar

v-pgoloju
Community Support
Community Support

Hi @Lars-6,

Thank you for reaching out to the Microsoft Fabric Forum Community.

 

A special thanks to @Deku and @adudani  for the quick and helpful response.

 

To dynamically retrieve data from an API in Power BI based on an input parameter, you can create a parameter and use it in the API URL within Power Query. Start by navigating to Home -> Manage Parameters -> New Parameter in Power BI Desktop. Name the parameter (e.g., InvoiceID), choose its data type (such as Text or Number), and either define a list of values or set it to "Any value" if you want more flexibility. Next, open Transform Data to launch Power Query, and create a new query that incorporates the parameter into your API URL. For example, the M code would look like this:

let
InvoiceID = Parameter, // this is the parameter you've created
Source = Json.Document(Web.Contents("https://your-api-endpoint.com/data?invoice_id=" & Text.From(InvoiceID)))
in
Source


After setting this up, click Close & Apply to load the data into your Power BI model using the dynamically constructed URL.

 

If you found this response helpful, please consider marking it as the accepted solution and giving it a thumbs-up to help others in the community.

 

Thank you & regards,
Prasanna Kumar

adudani
Super User
Super User

hi @Lars-6 ,
thank you @Deku  for your insights, which I agree with.

 

Additionally, some sample implementations:

1. Dynamic Power BI reports using Parameters - YouTube

2.Revisiting a Power BI solution with Dynamic M Parameters - YouTube

3. Lastly, you could take look at populating the list from a query to get all requried ids: Populate a Power BI parameter list using a query

 

Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a Kudos 🙂
Kind Regards,
Avinash

Okay, I have the parameter in a api url string, so I can change the input for the api. This means that I can pull data per invoice id. Do you know how I can do this in any other way so when I change the slicer the api request url also changes.

 

Already thanks!

 

Lars

Deku
Super User
Super User

Dynamic M parameter. Only works with direct query. Would avoid unless very good reason to use them


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

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 Solution Authors
Top Kudoed Authors