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!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi,
I am fairly new to Power BI and need help with the following scenario.
- I am using Python Script as the datasource.
- This python script calls REST APIs internally with tokenA as the API token and creates 4 dataframes such as ModelA, ModelB, ModelC and ModelD.
- These dataframes are then treated as models in Power BI and I create report/dashboard from the data.
- Now, I want to edit the API token used in the python script to tokenB and save it. On saving, the 4 models should be updated with the new data.
- To achieve this, I tried to find a way to edit the Pyhton script source but could not find anything. So, I had to edit the Source of ModelD and save it.
-----
- On doing this, the script returns 4 dataframes ModelA, ModelB, ModelC and ModelD again but now these dataframes gets assigned to ModelD. Instead, the output of dataframes should have mapped to the existing models which were created in the intial steps.
The update of API token is just one scenario, there might be cases where I need to add/remove dataframes returned from the script?
Is there a way to edit the original python script which affects all the models which were created from this script?
Let me know if you need additional data to answer my query.
Regards
You are running these four models four times each . It would be easier to run each model separately, and create only one dataframe which can map to exactly one query output.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 35 | |
| 34 | |
| 31 | |
| 27 |
| User | Count |
|---|---|
| 135 | |
| 102 | |
| 67 | |
| 65 | |
| 56 |