cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bdl5119
Frequent Visitor

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?

bdl5119
Frequent Visitor

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Kudoed Authors