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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Run R script feature

Hi there

July Update is kinda cool! In Run R Script feature, what if I want to reference another tables in PowerBi model, how can I do that?

 

Say I have 2 tables

Table1 - during my data wrangling process in Table1 I might want to merge to table2. dataset is table 1 so within this script window what would table2 is known as in this R script window?

 

Hope you can advice.

 

Pedzilla

1 ACCEPTED SOLUTION
ankitpatira
Community Champion
Community Champion

@Anonymous Run R Script feature applies to selected query within query editor. So when you click on Run R Script button it actually creates 'dataset' data frame for the selected query. It doesn't create data frames for all the queries within query editor but only for selected query that you click button.

 

So if you really want to merge queries using R (power bi query editor has merge queries option already), then you should go to New Data Source -> Other -> R Script -> connect to both your data sources, merge and then load in power bi desktop. But unfortunately I think Run R Script button only references selected query and not all the queries. 

View solution in original post

1 REPLY 1
ankitpatira
Community Champion
Community Champion

@Anonymous Run R Script feature applies to selected query within query editor. So when you click on Run R Script button it actually creates 'dataset' data frame for the selected query. It doesn't create data frames for all the queries within query editor but only for selected query that you click button.

 

So if you really want to merge queries using R (power bi query editor has merge queries option already), then you should go to New Data Source -> Other -> R Script -> connect to both your data sources, merge and then load in power bi desktop. But unfortunately I think Run R Script button only references selected query and not all the queries. 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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