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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
webportal
Impactful Individual
Impactful Individual

How to export an R dataframe to a Power Query table

I'm using an R script within Power Query to do some data transformations and return a scaled table. My R code is like this:

# 'dataset' contém os dados de entrada neste script
library(dplyr)
df_normal <- log(dataset+1) %>%
select(c(2:4)) %>%
scale df_normal <-cbind(dataset[,c(1)], df_normal)
output <- df_normal

This works OK in R Studio and I'm getting the df_normal dataframe as expected.

However, in Power Query I get an empty table!

r

How do I export the dataframe to a table?

3 REPLIES 3
d_gosbell
Super User
Super User

I have not done much with R, but have you tried changing the last line to 

 

dataset <- df_normal

 

as I believe that the 'dataset' variable is the interface between Power Query and R.

webportal
Impactful Individual
Impactful Individual

@d_gosbell  thanks, I tried it, but it's still empty.

@webportal ,

 

The latest version of Power BI Desktop seems to work for me.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.