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.
Hello all,
In my scenario I want to accomplish below steps but it takes very long, I waited more than 20minutes.
1. Import data from sql with python( with pyodbc)
2. Manipulate the data, create timeseries forecasting as dataframe(pandas)
3. Send result table to PowerBI and visualize it.
4. Publish report to service and share the report.
In my local python script runs without any error and it takes <1 minute.
But when I try to run it in PowerBI (Get Data->Python script->copy/paste script) it takes very long and throws an error in the end.
Python-PowerBI examples on web are quite simple as just read data from some csv or xlsx file. I didn't see any advanced examples.
So I have several questions about it.
1. Is there any way to accelerate this?
2. Can I use scripting for existing table in PowerBI? - because I can get data from SQL via PowerBI without using Pythonç
3. If everything runs smoothly how does it work in service(powerbi app) ? When people hit refresh how the calculation goes, etc.
4. Is there any other scenario that comes to your mind in order to achieve the steps that I mentioned in the beginning of the post.
Any comment would be helpful.
Thanks in advance.
Solved! Go to Solution.
Hi @Anonymous ,
1. You could try higher version of Python.
2. So your datasource is SQL Server, right?
You could import data from SQL Server directly. If you want to custom the sql queries, you could set it like the image below.
3. If you want refresh data in service, based on this document, It is not supported to implement schedule refresh via on premise Data Gateway (Enterprise Gateway) for Python in Power BI Service currently .
Hi @Anonymous ,
1. You could try higher version of Python.
2. So your datasource is SQL Server, right?
You could import data from SQL Server directly. If you want to custom the sql queries, you could set it like the image below.
3. If you want refresh data in service, based on this document, It is not supported to implement schedule refresh via on premise Data Gateway (Enterprise Gateway) for Python in Power BI Service currently .
Hello @v-eachen-msft
Thanks for the comment, I tried but it didn't work, I mean it takes ages to load so I change the pipeline to :
Get data from SQL - execute Python script - write back result to SQL - get data from SQL with PowerBI instead of SQL-Python-PowerBI.
I really don't know why it is so slow but in case someone searching for similar situation, writing result back to SQL is much faster than Python-PowerBI connection. I guess this connection works fine for simple scripts.
Thanks!
Hi @Anonymous ,
Does that make sense? If so kindly mark my answer as a solution to close the case. Thanks in advance.
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 |
---|---|
110 | |
94 | |
82 | |
66 | |
58 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |