Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!View all the Fabric Data Days sessions on demand. View schedule
Hi everyone,
I have a parameter, that has an invoice id in it.
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:
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?
Solved! Go to Solution.
Dynamic M parameter. Only works with direct query. Would avoid unless very good reason to use them
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
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
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
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
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
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
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
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
Dynamic M parameter. Only works with direct query. Would avoid unless very good reason to use them
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!