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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

PYTHON SCRIPTS IN POWER BI

Hi,

 

Is there any way I can call one python script in one page from another python script in another page? I have a report to be exported to Excel and it has multiple pages. Each page has a different set of filters so I can't use the data sources from one page. Or is there a way I can define filters in the python script?

I have a script in one page which can export that page into excel using dataframe.to_excel() from pandas, but to cover data from multiple pages I should either be able to call all the scripts in one script or be able to define the filters inside the code.

Any help would be appreciated.

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

According to my attempt, I can't directly export the data of different pages using python.

You can try to use the same data source to publish different reports, and then set the schedule refresh to export to different Excel files.

 

Best Regards,
Liang
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 @V-lianl-msft ,

Thanks for the reply, but I can't change the format of the report and I don't want a scheduled refresh to export rather a button click to export to excel. Is there any way I can do that? I tried using powerapps visual to create a button which is based on power automate flow but that again comes down to checking the boxes for the data to be sent in leading to the filters issue again. Any work around for that? Or how do I use power automate to export the report to excel?

 

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.