cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
bruparel
Regular Visitor

Simple BoxPlot not showing in the R and Python Visuals

I am trying to create an R visual (boxplot) in my Power BI desktop app.  Here is a one liner from R that creates the boxplot:

 

boxplot(mpg~cyl,data=mtcars, main="Car Milage Data", 
   xlab="Number of Cylinders", ylab="Miles Per Gallon")

 

Note that this uses the built in mtcars dataset that is available out of the box with each R install.  this works fine in R and shows the boxplot.

 

Note that I know how to import this dataset into R/Python by going to Other sources and picking either R or Python Scripts.  For R as an example, I entered:

 

df <- mtcars

 

And connected to the datasource before proceeding to build the Visual.  I can see the fields belonging to this dataset in the 'query' pane and dragged the fields that I am interested in, i.e., mpg and cyl in the Values Box. Which makes them available in the "dataset" dataframe, so the aforementioned one liner becomes:

 

boxplot(mpg~cyl,data=dataset, main="Car Milage Data", 
   xlab="Number of Cylinders", ylab="Miles Per Gallon")

 

However, when I try to show it as an R Visual Custom control, all I get is a line within a frame and no boxes.  My desktop is the latest October release of Power BI (2.63.3272.40461 64-bit (October 2018)

 

I get no error messages.  Same thing is happening to the Python Seaborn boxplots.

 

Please advise.

 

Thanks.

 

Bharat

1 ACCEPTED SOLUTION

Accepted Solutions
bruparel
Regular Visitor

Re: Simple BoxPlot not showing in the R and Python Visuals

I figured it out.  Any numeric variable that you are trying to plot must have 'Do not Summarize' checked instead of 'Sum' which Power BI does by default.  Once I did that, the boxplot appeared fine.  I think that the default in Power BI must be changed.

View solution in original post

2 REPLIES 2
Microsoft v-yulgu-msft
Microsoft

Re: Simple BoxPlot not showing in the R and Python Visuals

Hi @bruparel,

 

Did you get a blank visual with above R code on report page? Can you show us a screenshot of result? Also, please test the sample in this blog to see if it works.

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
bruparel
Regular Visitor

Re: Simple BoxPlot not showing in the R and Python Visuals

I figured it out.  Any numeric variable that you are trying to plot must have 'Do not Summarize' checked instead of 'Sum' which Power BI does by default.  Once I did that, the boxplot appeared fine.  I think that the default in Power BI must be changed.

View solution in original post

Helpful resources

Announcements
New Ranks Launched March 24th!

New Ranks Launched March 24th!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power BI Community!

‘Better Together’ Contest Finalists Announced!

‘Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Arun 'Triple A' Event Video, Q&A, and Slides

Arun 'Triple A' Event Video, Q&A, and Slides

Missed the Arun 'Triple A' event or want to revisit it? We've got you covered! Check out the video, Q&A, and slides now.

Join THE global Microsoft Power Platform event series.

Join THE global Power Platform event series.

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities.

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors