Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Does anyone know how you can show the result of an R script in a dashboard?
And I don't mean the charts, but for example the result of the r script :
input <- warpbreaksprint(head(input))
output <-glm(formula = breaks ~ wool+tension, data = warpbreaks, family = poisson) print(summary(output))
Thank You!
I haven't tested the solution on summary() outputs, but I have done this with a numeric output value. A way around this is to utilize ggplot() + geom_text() in order to output a text value. I used this in a predict function where:
p <- predict(fit, test.data)
ggplot() + geom_text(aes(0, 0, label = p))
That got me a plot that has my numeric value in the center. If you mess around with the arguments available for the function you can make it look a lot nicer than that. It's not great, but it works until Power BI starts allowing us to output printed values to a report.
If that works, please mark it as a solution. Thanks!
it's a bit of a workaround, but the gridExtra package should be able to do what you're after - grid.table() instead of print can be used to display the result of the summary function (see here for more detail on what it can do).
Note that this might not be completely what you're after, as it produces an image and displays that, rather than an actual table you can copy data out of.
Another way would be to save the output in a text file and then create a table visual in PowerBi and pull the data with 0 width. The issue here is one would need to refresh the table visual.
require(gridExtra) pathToProject <- "F:\\PowerBIDocuments\\" t <- summary(dataset$hwy) grid.table(t) out <- capture.output(t) cat(out, file=paste0(pathToProject,"results.txt"), sep="\n", append=FALSE)
@fverhagen In power bi desktop you can use R script visual to visualise output of R scripts. However it is currently not supported in power bi service and you will only find it working in power bi desktop. Please vote for my idea here to have R visual support in power bi service. Check this blog post on using R visuals in power bi desktop.
Unrelated and doesn't answer the question (explicitly about outputting the data from an R script, not a visualisation).
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
79 | |
78 | |
59 | |
36 | |
33 |
User | Count |
---|---|
94 | |
61 | |
56 | |
49 | |
41 |