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
HimakarM
New Member

Python run time error in Power BI

Hi,

 

I am facing a run time error while executing the python code mentioned below which creates a bar chart row facet visual.

 

Py code - 

import plotly.express as px
fig = px.bar(dataset,x = 'employee', y = 'salary', facet_row = 'job_title ', color = 'job_location')
fig.update_layout(legend_orientation = 'h', x=-1, y=1.2)
fig.show()
 
Error - Can't display the visual
scripts stop running after 5 minutes. To fix this, reduce your script's runtime and try again
 
Can anyone assist me to resolve this issue? 
 
It will be a great help if anyone comes forward with the solution and also wanted to know the reasons for encountering this issue in Power BI.
 
Thanks in advance!
 
2 REPLIES 2
v-lili6-msft
Community Support
Community Support

hi @HimakarM 

This is a known limitation:

Python visuals in Power BI Desktop have a few limitations:

  • Data size limitations. Data used by the Python visual for plotting is limited to 150,000 rows. If more than 150,000 rows are selected, only the top 150,000 rows are used and a message is displayed on the image. Additionally, the input data has a limit of 250 MB.
  • Resolution. All Python visuals are displayed at 72 DPI.
  • Calculation time limitation. If a Python visual calculation exceeds five minutes the execution times out which results in an error.

 

https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-python-visuals#known-limitations

 

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for the valuable information, Lin.

 

My script doesn't contain any calculations apart from the legend positioning. I am able to plot the visual by excluding this step mentioned below. 

fig.update_layout(legend_orientation = 'h',x=-1, y=1.2)
 
The above line is included in my script to plot a customized legend using the coordinates. Can you please shed more light on this run time error and the chances of encountering this problem?

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.