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
Irissie-2
Frequent Visitor

Undefined variables when using R visual

I am trying to build a visual with R, but I cannot use the variables I have in my datasets.

When I select the R visual and want to select which variables I want to use, they are undefined (I selected two, see below).

 

 

# The following code to create a dataframe and remove duplicated rows is always executed and acts as a preamble for your script: 

# dataset <- data.frame(undefined, undefined.1)
# dataset <- unique(dataset)

# Paste or type your script code here:

 

 

Does anyone know why this happens?

 

I have built dashboards using PowerBI visuals with this dataset and these variables before, I just want to add a new visual to a page.

7 REPLIES 7
ranakashi007
New Member

I am facing the same issue and unable to find any solution.😐

Irissie-2
Frequent Visitor

Table columns

Are these table columns called "undefined" and "undefined.1" ? Are they maybe the result of a column split operation in Power Query?

No, they actually all have meaningful names, that also work in the visuals. It happens to all columns, in all tables. Maybe it has to do with a setting somewhere? But I don't know where to look..

There's only a single prompt to enable scripting when you set this up the first time.

 

Can't reproduce your issue.  Can you try with a fresh PBIX and some sample data?

Good point. I tried with example data and then everything was normal..

But on all of our own data (separate source data, separate PowerBI files) it doesn't work and shows undefined.1 etc.. 

lbendlin
Super User
Super User

when you say "variables"  do you mean table columns or measures?

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.