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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Super User
Super User

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.