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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
peterhui50
Helper III
Helper III

Using an R script -- how to refer to another table ?

Hi,

 

I am just testing a simple script but I don't know how to refer to another table. I don't know how to refer to [SALES_TABLE] in an R script.

 

I can probably break it down in PQ and do the joins there, but sometimes it's easier to just paste in a script first as test.

 

# 'dataset' holds the input data for this script

 

library(dplyr)

 

dataset_2 = dataset %>%
filter(Units== "Y") %>%
inner_join(SALES_TABLE,  c("Unit_ID")) %>%
select(Units_ID, Unit, Sales) %>%

sample_n(100)

 

dataset_2

1 ACCEPTED SOLUTION
v-yingjl
Community Support
Community Support

Hi @peterhui50 ,

As far as I know, currently it is not supported in power bi.

You can vote for this idea or create a new idea here to help us improve power bi:

Query Editor: Allow R Scripts to Reference Existing Queries 

 

It is a place for customers provide feedback about Microsoft Office products . What’s more, if a feedback is high voted there by other customers, it will be promising that Microsoft Product Team will take it into consideration when designing the next version in the future.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

2 REPLIES 2
v-yingjl
Community Support
Community Support

Hi @peterhui50 ,

As far as I know, currently it is not supported in power bi.

You can vote for this idea or create a new idea here to help us improve power bi:

Query Editor: Allow R Scripts to Reference Existing Queries 

 

It is a place for customers provide feedback about Microsoft Office products . What’s more, if a feedback is high voted there by other customers, it will be promising that Microsoft Product Team will take it into consideration when designing the next version in the future.

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

@peterhui50 , I have not tried R, But in python, whatever column and measure you dragged on visual they are available to you.  Tables should be joined in power to drag columns together

 

refer if needed https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-r-visuals

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors