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.
In Python Script in Power BI, I would like to write:
from personal_script.py import function
Is there a way of doing this?
Thank you
Solved! Go to Solution.
@Anonymous ,
I'm afraid this can't work in power bi. I have created a sample module with simple code in structure like below:
Func/
__init__.py
Func1.py
Code in Func.py
def func(): print("Hello World")
Code in __init__.py
from Func.Func1 import func
import sys sys.path.append(full_path) from Func import func if __name__ == "__main__": func()
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous ,
I'm afraid this can't work in power bi. I have created a sample module with simple code in structure like below:
Func/
__init__.py
Func1.py
Code in Func.py
def func(): print("Hello World")
Code in __init__.py
from Func.Func1 import func
import sys sys.path.append(full_path) from Func import func if __name__ == "__main__": func()
Community Support Team _ Jimmy Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you very much for your answer 🙂 it will be nice to have this feature in the future.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
143 | |
109 | |
103 | |
82 | |
74 |