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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
leemhmark
New Member

Data fields not loaded into R script visual

Hello,

 

My organization recently updated Power BI Desktop to a new version (version 2.96 August 2021), and since then I'm unable to import data fields to R script visual in my dashboard. Previously if I drag a field called "Data_field_1" to Values for R script visual, under the R script editor window the code will change to something like:

 

#dataset <- data.frame(Data_field_1)
# dataset <- unique(dataset)
 
But now when I drag a field to Values, my R script editor window shows:
 
# <- data.frame()
# <- unique()
 
Which means it's not being properly imported? Are there any settings I should change to fix this issue?
 
Thanks!
4 REPLIES 4
V-lianl-msft
Community Support
Community Support

Hi @leemhmark ,

 

This thread could help you,please refer to this thread:

https://community.powerbi.com/t5/Issues/R-Visualisation-not-auto-populating-data-frame-in-script-edi... 

 


Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Liang,

 

I've read through that post twice and still don't quite understand what I should. When I clicked the Edit script in external IDE button on my Power BI R script editor, it launched RStudio and opened the REditorWrapper.R file with the following contents:

 

# Input load. Please do not change #
`dataset` = read.csv('C:/Users/REditorWrapper_936e8622-f961-43f5-a6a3-d874b4116f21/input_df_57db46b4-c778-4a34-9e2a-46876a425600.csv', check.names = FALSE, encoding = "UTF-8", blank.lines.skip = FALSE);
# Original Script. Please update your script content here and once completed copy below section back to the original editing window #
# The following code to create a dataframe and remove duplicated rows is always executed and acts as a preamble for your script:

# <- data.frame()
# <- unique()

# Paste or type your script code here:

 

Should I then copy/paste the `dataset` = read.csv line into my Power BI R Script Editor to force it to load?

 

Thanks

 

vanessafvg
Community Champion
Community Champion

can you not use the latest version?  it would be hard to know without being able to replicate what you are doing.





If I took the time to answer your question and I came up with a solution, please mark my post as a solution and /or give kudos freely for the effort 🙂 Thank you!

Proud to be a Super User!




Unfortunately no, my organization has a strict policy and I can only install the software they currently publish internally so I'm unable to downgrade to an older version just to test it.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.