Skip to main content
Microsoft Idea

Power BI

Under Review

Multiple datasets in r script visual

Vote (48) Share
Tobias Dirksen's profile image

Tobias Dirksen on 01 Jul 2016 19:00:37

Sometimes one needs R to merge two tables. However, one can only import data in R from different tables, if there is a clear relationship between the tables. Therefore, please allow multible datasets in the R Script Visual.

Comments (4)
Tobias Dirksen's profile image Profile Picture

Power BI User on 05 Jul 2020 23:29:36

RE: Multiple datasets in r script visual

Yes, an addition most urgent!
A possible workaround (provided your filtered "parameters table" consists of only one record) would be to create a column of 1s in each of the tables and create a one to many relationship between the "parameters table" and the "base table". However, even in this, Power BI enforces cardinality on the level of original parameter and base tables that define your dataset rather than filtered parameter and base tables that you have in your report, and renders such a join inadmissible

Tobias Dirksen's profile image Profile Picture

Power BI User on 05 Jul 2020 23:28:59

RE: Multiple datasets in r script visual

Lot of times,we would like users to provide a parameter value and based on that you need to run script for a model e.g. providing k value for K means. Currently, it is not possible. Looks like Michael is talking about R used for data import.

Tobias Dirksen's profile image Profile Picture

Michael Lucht on 05 Jul 2020 22:50:54

RE: Multiple datasets in r script visual

Actually, that is possible: you can add tables in the second argument of the R.Execute command. Eg. instead of R.Execute("#your R script",[dataset=Source]), use R.Execute("#your R script",[dataset1=Source1,dataset2=Source2])

Tobias Dirksen's profile image Profile Picture

Frank Thomson on 05 Jul 2020 22:35:54

RE: Multiple datasets in r script visual

Yes, I would like to do this do!
What is the current status of this?