David E on 23 Dec 2015 01:54:41
The R.Execute () Power Query function only allows you to use R for ingesting data. Ideally, make R.Execute () more powerful by making it a data transformation function as well as data source. Let data be loaded from other sources, and then R.Execute () could be called in a subsequent step in the Power Query query.
let
Source = Excel.Workbook(File.Contents("C:\[...].xlsx"), null, true),
Custom1 = R.Execute("df<-data.frame(Source) [...]")
in
Custom1
Transformations could all be done in R first, but it's slower in general, and you lose the convenience of blending data in Power BI itself.
- Comments (6)
RE: Pass data from another source as input to the R.Execute () function
I think this feature has already been implemented. Here is an example
let
Source = #table({"num"},List.Accumulate({1..10},{},(s,c)=>s&{{c}})),
RScript = R.Execute("df<-dataset#(lf)df$fact<-factorial(df$num)",[dataset=Source]),
out = RScript{[Name="df"]}[Value]
in
out
RE: Pass data from another source as input to the R.Execute () function
AWESOME! It's working in Desktop!
RE: Pass data from another source as input to the R.Execute () function
If I'm not mistaken we could use this functionality also to push data from Power BI to Excel. Although the ability to connect to a PBI model via Excel is great, this is a pull-mechanism and sometimes there is a requirement to push data in a table-format to Excel. There are also requirements to export more than 1.1 Mio rows - to csv or text - R could be used as a workaround for these cases. At the moment the only way to go is via a visualisation and there we're experiencing a row-limit of 150k. Folks sometimes like to use the transformations they've done in PBI (desktop!) not only in visualisations there, but also (reuse) for other tasks.
RE: Pass data from another source as input to the R.Execute () function
Really great feature to have.
RE: Pass data from another source as input to the R.Execute () function
I second this idea. This would make Power Query a real winner
RE: Pass data from another source as input to the R.Execute () function
This is blocking for us since R doesn't support our data sources natively while Power BI does.