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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
webportal
Impactful Individual
Impactful Individual

R script to read table in data model

Is it possible to use "Get data / R script" in Power BI Desktop to read a table already loadad in the data model?

 

I know I can use Power Query / Transform to do this, but the output of the R script must contain the same number of rows of the table, otherwise it will return an error.

 

For example, in this other question I've used an R script to cluster 12.000 customers. It works fine if all we need is to add the cluster number to each customer in a new column of a table, but if we need to further analyse the results, like clusters sizes for example, we should be able to generate another table with 3 rows only (we have 3 clusters) - but that doesn't seem possible to do!

 

Or is it? Can anyone help? It would be really amazing to have an integration of Power BI with R algorithms 

 

I have been reading the documentation and other questions related with R in Power BI but it seems that the only possible outputs are: 

  1. Visuals
  2. Columns added to existing tables with exactly the same dimension
  3. Tables imported from external sources

But R algorithms return all sorts of objects with different sizes and those don't seem to be possible to analyse in Power BI.

 

If anyone has a better idea about how to run R algorithms in Power BI, I'd be thankful.

1 ACCEPTED SOLUTION
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @webportal ,

Each pbix is an as model, you could use AS connector to connet the model you have created in your former data:

https://www.biinsight.com/four-different-ways-to-find-your-power-bi-desktop-local-port-number/

 

Regards,

Daniel He

Community Support Team _ Daniel He
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

1 REPLY 1
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @webportal ,

Each pbix is an as model, you could use AS connector to connet the model you have created in your former data:

https://www.biinsight.com/four-different-ways-to-find-your-power-bi-desktop-local-port-number/

 

Regards,

Daniel He

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

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors