Skip to main content

Power BI

Under Review

Multiple datasets in r script visual

Vote (47) 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

3868cdee b7ad-4d24-a5da-11b5b8390c65 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

b557eb80 0dd1-459a-9e27-5f49cf90d850 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

8b1a0cc3 5d78-44e4-a41d-c1b9c3b10f00 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

507cf08d 94de-4a7a-9314-67581767297d 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?