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
Anonymous
Not applicable

R Custom Visual - using data from R script (not importing from Power BI)

I was following this tutorial: https://docs.microsoft.com/en-us/power-bi/developer/visuals/funnel-plot-from-r

My impression was that "dataset.csv" file was read in with "read.csv" function in the R script which was used for the plot. But when I import the visual to Power BI it asks me to import the CSV file in Power BI.

As a simpler example, with the template code given here:

g = qplot(`Petal.Length`, data = iris, fill = `Species`, main = Sys.time());

I thought it was going to use the "iris" dataset when imported but it again asks me to import a source dataset.

My intention is to read in the data in R script (e.g. from web) to use them for the plots, without again importing the data in Power BI.

Would this be possible? Any help would be appreciated!

3 REPLIES 3
lbendlin
Super User
Super User

Yes. Use a different tool instead of Power BI.

lbendlin
Super User
Super User

Have you changed this line 

dataset = read.csv(file = "dataset.csv", header = TRUE, sep = ",", stringsAsFactors = FALSE)

to point to a web based data file instead?

Anonymous
Not applicable

Thanks @lbendlin , I've tried and it works. Only one caveat is that I still need to supply any data to get it working (even if it's nothing to do with the data for plotting). Looks like this is the best I can? I wonder if there's any way to omit the step of putting the data itself in Power BI? Thank you!

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.

Top Solution Authors