Showing results for 
Search instead for 
Did you mean: 

R Script Multiple Sheets

I have several tables in Power BI and want to use R to do transforms and data manipulation on them. I can see that within a table, I can run an R script (the current table is referenced as 'dataset'). However, I'm unable to see how to reference multiple tables (e.g., join them together, run analyses on one table and use them to calculate values for another, etc.). 


It is possible to pre-process the data in R, save the tables, and then load them into powerBI. However, I'd love to have it all contained within PowerBI. I prefer to work in R rather than messing with DAX and M. Is there any way to do this? Or, do I need to pre-process data in R prior to import? 

Community Support
Community Support

Hi @TomCarpenter ,


There are still some limitations to using R scripts in Power Query Editor to process data from multiple tables. I found a post where the steps are documented, I hope it will help you.

Operations on multiple tables / datasets with Edit Queries and R in Power BI


It is not clear what data source you are using. If you tend to use R for your data, consider pre-processing it before importing it to your desktop. 


In Power Query Editor, using M formula to process data should be the best choice, and it is quick to get started.


Best Regards,
Community Support Team_Gao


If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors
Top Kudoed Authors