Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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.
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:
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:# Setuplibrary(dplyr)library(ggplot2)df <- dataset############## Data#############df1 <- df %>% filter(Category == 'b1')df2 <- df %>% filter(Category == 'b2')dfL <- df %>% filter(Category == 'line')
############## Chart setup#############
# Lineplt <- 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 1plt <- 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 2plt <- 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 clutterplt <- plt + theme_minimal()plt <- plt + theme(legend.position="none")plt <- plt + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())
# Axis formatplt <- plt + theme(axis.line.y = element_line(colour = "grey50"))plt
Result:
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
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.
Proud to be a Super User! | |
Can you please confirm what you mean by the layered approach you mentioned?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |