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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
jba302
New Member

R Integration ( dependent scripting?)

Hello,

I spent a lot of time trying to hunt this down to no avail, if someone happens to know a link to the answer it would also be appreciated.

 

I am interested in finding a way to build an R script into a dashboard for modeling and projections. There are 2 ways that I can do this that I'm aware of -

 

1. R script is built first, then power bi digests the data and visualizes it. This is very nice to standardize the visualizations and has the neat mouse-over thing going for it, but it does not allow for active slicing (depending on what I am looking to do, more on that below). 

 

2. Use Power BI to call the data first, then add in an R visualization widget. This is nice since the slicers are actively changing the underlying data set, so I can produce a single dashboard for a single idea, and anyone can slice the underlying data to get an answer. However, this only produces an R(really, just ggplot2 since it can be made not-awful looking) visualization. This causes some complexity in maintaining and developing a standard visualization process, and omits some abilities of Power BI (like mouse-over).

 

I would like to combine the two, which means calling the cube with power bi, then manipulating the data using R in the advanced editor, then outputting a table that power bi can perform visualizations on. I want to do this because I cannot just aggregate the results of indivudal slices for many situations. 

 

This is essentially a single step that I'm not grasping, which is -

How do I call the data that is already in power bi using R within the power query editor? If it matters, the output data is currently "XYZ" and the final step is a cube.transform(). Thanks!

2 REPLIES 2
deldersveld
Resident Rockstar
Resident Rockstar

The R Script in Power Query currently only allows R to ingest data on its own. You cannot use it in the same PQ script to access data that originally came from another source. There may be a few relevant ideas to vote on here to enhance that functionality: https://ideas.powerbi.com/search?filter=ideas&query=r%20script

Bummer, but at least that stops me from continuing the research for now. Thanks!

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.