Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
sezerunar
Frequent Visitor

Table with R Script

Hi there,

 
I am trying to make a table visual with Rscript.
 
The below is my code:
 
# The following code to create a dataframe and remove duplicated rows is always executed and acts as a preamble for your script:

# dataset <- data.frame(unique)
# dataset <- unique(dataset)

# Paste or type your script code here:
library(DT)
DT::datatable(dataset)
 
However, it doesn't return any visual. It says "No image was created. The R code didn't result in creation of any visuals. Make sure your R scripts results in a plot to the R default device."
 
I can make ggplot2 visuals, but why not DT table or GT table?
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @sezerunar ,

 

This error message suggests that the DT::datatable function is not generating a plot. The DT package is designed to create interactive tables in R, but it may not be compatible with Power BI.

 

Please try to use a different package: Instead of , you could use the package to create a table as a static plot. This way, the visual can be rendered as an image in Power BI. 

library(ggplot2)
library(gridExtra)

# Assuming 'dataset' is your data frame
# Create a simple table visual using 'tableGrob' function from 'gridExtra' package
table <- tableGrob(dataset)
grid.draw(table)

This will create a static table visual as an image that Power BI can display.

 

 

 

Best Regards,

Neeko Tang

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

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @sezerunar ,

 

This error message suggests that the DT::datatable function is not generating a plot. The DT package is designed to create interactive tables in R, but it may not be compatible with Power BI.

 

Please try to use a different package: Instead of , you could use the package to create a table as a static plot. This way, the visual can be rendered as an image in Power BI. 

library(ggplot2)
library(gridExtra)

# Assuming 'dataset' is your data frame
# Create a simple table visual using 'tableGrob' function from 'gridExtra' package
table <- tableGrob(dataset)
grid.draw(table)

This will create a static table visual as an image that Power BI can display.

 

 

 

Best Regards,

Neeko Tang

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors