Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Using multiple tables/data to create a new data via R script

Hi all,


I'm a newbie PowerBI user and would like to get some help with the following scenario. Suppose I have data1 and data2 loaded into power BI through say, excel and sql. And I would like to have a data that takes in data1 and data2 as inputs, do some  complicated transformations and calculations via an R script, and have it as data3 in the report.  Does anyone know if this is possible?


So far the only way I found via searching is either just load data1 and data2 in the r script (instead of having them come from power BI). But I would like to avoid this approach due to various reasons.


One other way is to "transform" an existing data via R script but in that scenario I seem to only have acccess to a a single data (data1 or data2), not both. 


Any advice?



Community Support
Community Support

Hi @wwyws0000 ,

What do you mean "do some complicated transformations", if you connect data1 and data2 in import mode, you can do transformations or create another table based on data1 and data2 in Power Query.


Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks for the reply. By "complicated transformations" I mean things that can't be done through joining, simple arithmetics, etc. 


Would you be able to give an example of a power query that uses data1 and data2 and sends them to an r script? say the r script is just  "doThisFunction(data1,data2)"

Helpful resources


2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

Thank you 2022 Review

2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.