Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!
When using the R script, is there an option to return a dataframe as a table for display alongside another R visual? So, I suppose that is really two questions 1) can a dataframe be returned from an R script and 2) can multiple objects be returned from an R script?
Yes, you may take a look at the following post.
OK so that is how you make a dataframe in R. Thanks. That doesn't show me how this can be displayed as a visual in PowerBI if that R code is run in an R visual.
What I mean to ask was whether I could put a dataframe containing something like summary statistics alongside an R visual… Say I plot a scatter plot and I want to display a linear trend across the scatter plot with its slope coefficient etc. I want to use the slicer to change the date range over which the graph is generated. I think my only option to display summary statistics is to annotate the graph with text. What would be vastly superior is to display summary statistics in a separate table with formatting etc. It doesn’t seem like PowerBI supports something like this in so far as I can tell.
It seems that you may use calculated columns and measures instead.
Hello,
I don't think that is what pk_123 meant.
Making charts with R often includes making different aggregations / calculations and then storing the cals alongside the data in data frame, on which the visuals are built on. The cals are then shown inside the visual (e.g. "stripline / target value", or standard deviation, or capability indices alongside bar chart or capability histogram).
In my case I have built the same data frame and chart in both standalone R application and then inside R visual in Power BI. I calculate Cpk and Cp indices by groups in a data frame. in standalone R everything goes fine, but when I have exact same data and exact same script in Power BI R, I get an error
df4$Cp <- df4$tol / (6 * df4$sdev)
" R script error. Error in '$<-.data.frame'('*tmp*', Cp, value = numeric(0)) :
replacement has 0 rows, data has 9
Calls:$<- ->$.data.frame
Execution halted
It would be nice to actually see the data frame built in power bi R in order to understand why this does not work. It works in standalone R.
Did anyone find a solution to return a table as an r visual in power bi?
Dear posters, did you find a solution? I have a similar issue and would like to know if there is a way to return a table from an R visual in power bi.
The Power BI Data Visualization World Championships is back! It's time to submit your entry.
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 61 | |
| 49 | |
| 30 | |
| 25 | |
| 23 |
| User | Count |
|---|---|
| 129 | |
| 104 | |
| 56 | |
| 39 | |
| 31 |