Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: ✅ Power BI Desktop and Power BI service
Script visuals let you write code in a scripting language to create visualizations in Power BI reports. Power BI passes the fields you add to the visual to your script, runs the script, and displays the result on the report canvas.
Important
R and Python visuals in Power BI, including R-powered custom visuals, retire in May 2027. After retirement, R and Python visuals stop working in published reports in the Power BI service, including reports published before retirement. Future versions of Power BI Desktop won't include R and Python visuals, so you won't be able to add them to reports. Older versions of Power BI Desktop continue to render them locally by using the R or Python installation on your computer.
Before retirement, replace these visuals with a built-in Power BI visual, a custom visual, or an analysis in a Fabric notebook. For more information, see R and Python visuals retirement.
Available script visuals
The following table lists the script visuals available in Power BI.
| Script visual | Language | Description |
|---|---|---|
| Python visual | Python | Create visuals with Python libraries such as pandas and Matplotlib. |
| R visual | R | Create visuals with R scripts and R packages. |
| R-powered custom visuals | R | Use R-based visuals from AppSource without writing R scripts. |
How script visuals work
When you add fields to a script visual, Power BI creates a data frame from those fields and passes it to your script. The script draws a chart, and Power BI displays the chart as an image on the report canvas.
- Power BI Desktop: Scripts run by using the R or Python installation on your computer. Install R or Python and any packages your script uses before you create the visual. For more information, see Run Python scripts in Power BI Desktop and Run R scripts in Power BI Desktop.
- Power BI service: Scripts run in a secure environment in the service. Only supported packages are available. For more information, see Learn which Python packages are supported and Create visuals by using R packages in the Power BI service.
Script visuals respond to filters and highlighting from other visuals. Because the result is a static image, you can't select elements in a script visual to cross-filter other visuals, and script visuals don't show tooltips.
Retirement of R and Python visuals
R and Python visuals in Power BI, including R-powered custom visuals, retire in May 2027. This retirement applies only to R and Python visuals in interactive Power BI reports. Python scripts that you use in Power Query to populate tables aren't affected.
What changes
- Power BI service: At retirement, all R and Python visuals stop working in published reports, including reports published before retirement.
- R-powered custom visuals: Custom visuals that use R also stop working at retirement.
- Older versions of Power BI Desktop: R and Python visuals continue to work locally by using the R or Python installation on your computer.
- Future versions of Power BI Desktop: After retirement, R and Python visuals are removed, so you won't be able to add them to reports.
Find affected reports
No migration within your report recreates your exact R or Python visual. You must replace each visual with a different visualization before retirement.
Review your reports for R and Python visuals. Save the scripts and a list of the packages they depend on.
If you use Power BI Project (PBIP) format and Git-integrated workspaces, search your report definitions in source control to find built-in R and Python visuals across multiple reports. Look for these
visualTypevalues:pythonVisualfor Python visuals.scriptVisualfor R visuals.
These values don't identify R-powered custom visuals. Review the custom visuals used in each report separately to identify any that depend on R.
Let people in your organization know which reports are affected.
Replace the visual in your report
Rebuild the visualization with one of the following options:
- A built-in Power BI visual.
- An existing custom visual from AppSource or your organization.
- A new custom visual that you build with the Power BI custom visuals software development kit (SDK). AI coding tools can help you create the visual.
Recreate the analysis outside the report
If you can't rebuild the visualization in a Power BI report, consider these alternatives:
- Fabric notebooks: Recreate the analysis and visualization in a notebook. You might need to update your scripts for supported languages, libraries, and data access.
- Fabric apps: Build an app for visualizations that you can't recreate in a Power BI report.
You can add both Fabric notebooks and Fabric apps to an org app to share them with your audience.