Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hi Power BI Community
We are using Power BI and want to also use R script in our queries. We tried using the "Using R in Power Query Editor" example here https://docs.microsoft.com/en-us/power-bi/desktop-r-in-query-editor that contains a very simple csv file for the datasource and example r script to run. What we are finding is that when we follow the example through we get the error below. Trying to debug this we have found that if we change the header names in the file to "a", "b" and "c" then the R script supplied in the example works finew with the new single value no space column headers. Is there a reason why we are having issues with the headers in R script? We are running PowerBi version 2.68.5432.841 (April 2019) with R version 3.5.2. We also tried upgrading the r version on another machine (again debugging as we thought it might be a machine issue) to 3.6.0 and get the same error.
Any help would be greatly appreciated.
R script error
DataSource.Error: ADO.NET: R script error.
Loading required package: lattice
Attaching package: 'mice'
The following objects are masked from 'package:base':
cbind, rbind
Error in parse(text = x, keep.source = FALSE) :
<text>:1:17: unexpected symbol
1: Day ~ 0+SMI+SMI missing
^
Calls: mice ... formula -> formula.character -> formula -> eval -> parse
Execution halted
Details:
DataSourceKind=R
DataSourcePath=R
Message=R script error.
Loading required package: lattice
Attaching package: 'mice'
The following objects are masked from 'package:base':
cbind, rbind
Error in parse(text = x, keep.source = FALSE) :
<text>:1:17: unexpected symbol
1: Day ~ 0+SMI+SMI missing
^
Calls: mice ... formula -> formula.character -> formula -> eval -> parse
Execution halted
ErrorCode=-2147467259
ExceptionType=Microsoft.PowerBI.Scripting.R.Exceptions.RScriptRuntimeException
Solved! Go to Solution.
You may take a look at the post below.
https://community.powerbi.com/t5/Desktop/Using-R-in-Query-Editor/m-p/591505#M280652
You may take a look at the post below.
https://community.powerbi.com/t5/Desktop/Using-R-in-Query-Editor/m-p/591505#M280652
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
84 | |
84 | |
73 | |
49 |
User | Count |
---|---|
143 | |
132 | |
110 | |
64 | |
55 |