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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Devanshu
Helper I
Helper I

Unable to get the combination chart having Line and Bubble

Hello Team,

Hope you're doing well

I am working on a solution where I need to create a combination chart that includes both a Line Chart and a Bubble Chart. However, I couldn't find an option for this among the available visualizations.

Could you please confirm if it's possible to create such a chart? If so, kindly guide me on how to achieve this.

Looking forward to your response.

4 REPLIES 4
Anonymous
Not applicable

Hi  @Devanshu, hello rajendraongole1, thank you for your prompt reply! 

 

Based on my research and testing, you can write an R script to create the desired chart and then use the built-in R script visual to display it in Power BI.

 

You can download and install R for free from many locations, including from the CRAN Repository.

 

Then find the root folder of R:
vyajiewanmsft_0-1740127813800.png

Run it and install related packages(Select a mirror image that is close to your physical location): 

install.packages("ggplot2")
install.packages("dplyr")

 

Next, add the visual, drag the relevant column, and fill in the script as follows:

# 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(Category, Label, Weight, X, Y)
# dataset <- unique(dataset)
# Paste or type your script code here:
# Setup
library(dplyr)
library(ggplot2)
df <- dataset
#############
# Data
#############
df1 <- df %>% filter(Category == 'b1')
df2 <- df %>% filter(Category == 'b2')
dfL <- df %>% filter(Category == 'line')
#############
# Chart setup
#############
# Line
plt <- ggplot(data = dfL,aes(x=X, y=Y)) + geom_line(color = 'green3', size = 1.1) + ylim(-0.02, 0.05)
plt <- plt + scale_y_continuous(labels=scales::percent, limits = c(-0.02, 0.055))
plt <- plt + geom_hline(yintercept=0., colour="grey50", lwd=0.5)
plt <- plt + geom_point(data = df1, aes(x=X, y=Y, size = log(Weight), stroke = 8), color = 'lightsteelblue2')
# Bubble 1
plt <- plt + geom_text(data = df1, aes(label=Label),hjust=0.5, vjust=0.5)
plt <- plt + scale_size_continuous( trans="exp", range=c(1, 20))
# Bubble 2
plt <- plt + geom_point(data = df2, aes(x=X, y=Y), shape = 'x', size = 4.5, color = 'red')
plt <- plt + geom_text(data = df2, aes(label=Label),hjust=-1, vjust=0.55, size = 4)
############
# Aesthetics
############
# Remove clutter
plt <- plt + theme_minimal()
plt <- plt + theme(legend.position="none")
plt <- plt + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())
# Axis format
plt <- plt + theme(axis.line.y = element_line(colour = "grey50"))
plt


Result:

vyajiewanmsft_1-1740128091372.png
More information for your reference:

Create Power BI visuals using R - Power BI | Microsoft Learn
Create an R-powered Power BI visual - Power BI | Microsoft Learn
powerbi - Bubble Chart with Line - Stack Overflow

 

Best regards,

Joyce

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

Hello Joyce,

Thanks for your reply.

The concern here is not with Power BI Desktop but with Microsoft Fabric.

I am using Power BI on Fabric, and currently, we don’t have the option to use R or Python. If that were available, I would have used Python to create this chart.

But thanks for your suggestion. I really appreciate your willingness to help.

Thanks,
Devanshu

 

rajendraongole1
Super User
Super User

Hi @Devanshu  -In Power BI, there's no built-in option for a combination chart that includes both a line chart and a bubble chart in a single visual. However, you can achieve this using a layered approach or custom visuals like denab  or Charticulator will helps you.

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Can you please confirm what you mean by the layered approach you mentioned?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.