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

Change search parameter in get data python script

Hi everyone!

I'm using "get data"->"python script" , and connect to a API with some search parameters, Import data, and then some transformation in Power BI.

Now I want to include another search parameter in the script (model stays the same), but I cannot change that script. I only find the "Refresh" button that runs same script without the possibility of editing it.

How can I change the script without having to change all the model?

Thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Please have a try.

Click Home>>Transform data>>Transform data.

vpollymsft_0-1658824291972.png

Then Click Home>>Advanced Editor.

vpollymsft_1-1658824337924.png

Then you can find the page now. Please have a try.

 

Best Regards

Community Support Team _ Polly

 

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

6 REPLIES 6
Anonymous
Not applicable

Hi @Anonymous ,

I have found a similar post, please refer to it to see if it helps you.

How to add parameters to Python script? 

  • If you want to pass a query parameter to python script, it is supported.
  • your python table is a table query created by python script, right? If so, it is created first, then loaded into Power BI Desktop to create a report from. If you want to use a slicer in the report to dynamically change the columns in your python table, I'm afraid this is not supported. 

Reference Parameter from within Python Script 

  • Please refer to this script. As the variable should be text value, we need translate the parameter as text type.

Best Regards

Community Support Team _ Polly

 

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

Anonymous
Not applicable

Hi @Anonymous 

I think that is the solution, but I cannot understand how to get to this screen, can you give me a hint here?

thanks!

121703.jpg

Anonymous
Not applicable

Hi @Anonymous ,

Please have a try.

Click Home>>Transform data>>Transform data.

vpollymsft_0-1658824291972.png

Then Click Home>>Advanced Editor.

vpollymsft_1-1658824337924.png

Then you can find the page now. Please have a try.

 

Best Regards

Community Support Team _ Polly

 

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

Anonymous
Not applicable

yes, here is where you can edit the python query script and add a search parameter.

thanks!

amitchandak
Super User
Super User

@Anonymous , refer if this can help

https://datakuity.com/2021/01/05/power-bi-pass-parameter-value-to-python-script/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks for the reference, but this is once you have loaded the data. I'm trying to change the script that gets the data originally from an API through a python script.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.