Forum Discussion

MicrosoftUser42's avatar
MicrosoftUser42
Frequent Visitor
1 year ago
Solved

Python Events not working?

Hi everyone,

 

I am trying to plot a graph with matplotlib in Power BI and as part of that, I am trying to implement click & hover events. Works fine, when I execute the code from VS Code, but nothing happens in PowerBI. Are events like this disabled? I assume that instead of actually implementing the resulting plot, PowerBI probably just renders it as an image? Then ofc I can forget about making python graphs in PowerBI interactive..

 

Best Regards

  • Hi MicrosoftUser42 - 

    Yes, your assumption is correct. When you use Python visuals in Power BI, Power BI generates the plots as static images rather than interactive objects. Power BI currently does not support interactive Python or R plots (like those created with plotly or bokeh), nor does it enable interactivity in plots created with matplotlib click and hover events. It simply renders the resulting plot as a static image and embeds it into the Power BI report.

    This means that any interactive features, such as click or hover events, will not work in Power BI. These events are handled in real-time by Python environments like Jupyter Notebook or VS Code, but Power BI lacks this interactivity layer for Python visuals.

    For interactive visualizations in Power BI, you might want to explore Power BI’s own custom visuals, such as the ones in Power BI Marketplace, or use third-party tools like Power BI’s integration with Power Apps for more advanced interactivity. Alternatively, Power BI’s built-in visualizations and custom visuals often provide similar functionality that can allow for user interaction (though limited compared to full Python interactivity).

     

     

3 Replies

  • Hi MicrosoftUser42 - 

    Yes, your assumption is correct. When you use Python visuals in Power BI, Power BI generates the plots as static images rather than interactive objects. Power BI currently does not support interactive Python or R plots (like those created with plotly or bokeh), nor does it enable interactivity in plots created with matplotlib click and hover events. It simply renders the resulting plot as a static image and embeds it into the Power BI report.

    This means that any interactive features, such as click or hover events, will not work in Power BI. These events are handled in real-time by Python environments like Jupyter Notebook or VS Code, but Power BI lacks this interactivity layer for Python visuals.

    For interactive visualizations in Power BI, you might want to explore Power BI’s own custom visuals, such as the ones in Power BI Marketplace, or use third-party tools like Power BI’s integration with Power Apps for more advanced interactivity. Alternatively, Power BI’s built-in visualizations and custom visuals often provide similar functionality that can allow for user interaction (though limited compared to full Python interactivity).