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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.