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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bdl5119
Advocate I
Advocate I

Import python script into powerBI and publish dashboard

Hello,

I am sourcing the python script file1.py in my dashboard for a visualization. However, since the file is stored locally in my C: drive, I cannot use the published dashboard. How can I store file1.py on my workspace online and execute it?

 

Code in power bi is:

exec(open("C:\\file1.py").read())

 

2 REPLIES 2
lbendlin
Super User
Super User

"However, since the file is stored locally in my C: drive, I cannot use the published dashboard"

 

Not sure what you mean by that - can you please elaborate?

 

Python and R scripts in a workspace require the use of a personal gateway.  Have you set that up?

Yes, but that is not feasible solution as others cannot generate the visualization if my lapop is switched off. The solution is for me to publish my code to PyPI then import it as a package.  

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors