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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
hiimhp
Microsoft Employee
Microsoft Employee

Connecting to R dataset - unable to connect

Hi! I am getting an error when I try to follow the steps in the doc here https://docs.microsoft.com/en-us/power-bi/desktop-r-scripts

Essentially I would just like to try to run an R script to connect to data. I have installed R in my local machine and I am not entirely sure what I am missing here. Help you be much appreciated!

 

The error I am getting is:

Details: "Exception of type 'Microsoft.Analytics.Modules.R.ErrorHandling.RException.Primitives.NotValidRDataException' was thrown."

13 REPLIES 13
Anonymous
Not applicable

Hi All!

Has anyone eventually resolved this issue?

I'm trying to connect to MS Azure Machine Learning Studio via PowerBI get data through R script and getting the same error:

 

"Details: "Exception of type 'Microsoft.Analytics.Modules.R.ErrorHandling.RException.Primitives.NotValidRDataException' was thrown.""

 

Running:

Windows v10

R v3.5.0

Power BI v2.69.5467.2151 64-bit (May 2019)

RStudio 1.2.1335

AzureML library

 

 

 

I'm getting the same error. Has anyone resolved without downgrading R?

 

I first got error messages due to bugs that were internal to my R code. Then after I fixed those bugs, I started getting this error. I conclude that my R code likely works and that the error is in the connection between R and Power BI. Perhaps Power BI doesn't like the way the R script is outputting results?

Anonymous
Not applicable

I have same issue with R-3.6.0, R-3.6.2 or with R-3.5.0. Anyone who could fix the issue?

I did get this working in the end with R-3.5.2

midlvlmgmt
Regular Visitor

I'm also running into this problem.  Installed earlier version of R (3.5.0), but this did not help.

mskim
Regular Visitor

It seems to be R-3.6.0 cause this error.

I install R-3.5.3 side by side and configure it to R home directory in PBI Desktop.

Then error message dissapears.

 

 

 

ImkeF
Community Champion
Community Champion

Don't think that this will resolve it. 

 

On 3.6.0 I get the exeption-error from above and if I go down to R Open I receive an empty table (while RStudio shows 2 tables of data).

 

So this is still buggy, unfortunately.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

ImkeF
Community Champion
Community Champion

Thanks, but this didn't resolve the error for me unfortunately.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

id installing a lower version also and this didnt resolve it for me either, although i did leave the higher version installed, did that need uninstalling or shoudl i just have had to change the version in power bi (which i did)

Anonymous
Not applicable

Same error here

Anonymous
Not applicable

Hi,

 

I have the same error here when using below script

 

= R.Execute("# 'dataset' holds the input data for this script#(lf)write.csv(dataset,""C:/Users/Documents/test2.csv"")",[dataset=#"Renamed Columns"])

ImkeF
Community Champion
Community Champion

Same here.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

elenton
Helper II
Helper II

I am getting the same error whie trying to follow the below example, i can run the commands in RStudio but can not pull into power bi

https://www.red-gate.com/simple-talk/sql/bi/power-bi-introduction-working-with-r-scripts-in-power-bi...

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

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

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.