Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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
Solved! Go to Solution.
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.
Hi @Anonymous,
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
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.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
73 | |
72 | |
38 | |
30 | |
26 |
User | Count |
---|---|
99 | |
87 | |
45 | |
43 | |
35 |