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.
I'm using Python Script to GET data from a RESTFUL API. The Python Script works well when I run outside Power BI Environment.
When I try to run Python Script with For Loop, I confront the error "Unable to connect. We encountered an error while trying to connect. Details: "The preview for Section1/Query1/Source doesn't exist.".
I have searched on Power BI Community but get no luck. The below links is not a solution for this case as the issue just appear when I try with For Loop (or try with the other Loop). While, the Python Script still works well inside Power BI if I excludes the loop block of code.
Error: The preview for Section1/Query1/Source does... - Microsoft Power BI Community
Python Script Error : The preview for Section1/Que... - Microsoft Power BI Community
Solved: Python script error:"the preview for section 1/que... - Microsoft Power BI Community
Are there any solutions for this? Thanks for your time.
Hi @lionx ,
Please check whether you have install Python successfully and install the packages you need correctly.
You may refer to offical blogs as below to learn more details.
For reference:
Run Python scripts in Power BI Desktop
Use Python in Power Query Editor
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you for your response. I do not think this is the issue from the Python side because it still works well if running Python script without LOOP. All the script also works well when I run the Script outside Power BI environment.
The error just happen when I run the Python script with a code block of LOOP in the Power BI (e.g., For Loop). I suppose this error occur from the Power BI side.
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 |
---|---|
111 | |
100 | |
80 | |
64 | |
58 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |