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
Michael1
Advocate II
Advocate II

Scatter Plot Aggregating X and Y

Hello Power BI Friends,

 

I am creating a Scatter Plot where the X-Axis and the Y-Axis are both two whole numbers in related tables.  The details are a key coming from one of the tables.

 

However, Power BI is forcing me to summarize my X- and Y- axes and therefore, my points are not plotting as they would for a simple scatter plot.

 

Scatterplot Question.png

 

Any suggestions are welcome!

 

Thank you,

 

Michael

1 ACCEPTED SOLUTION
BhaveshPatel
Community Champion
Community Champion

Hi Micheal

 

You can use R script to get a scatter chart with non aggregated values. The script is simple.

 

You should create your dataset by dragging the fields into the values area and write the below script.


plot(dataset$SGPScore, dataset$SGPSTARRdg, xlab=”SGP Score”, ylab=”SGPSTARRdg”, xlim=c(0,300), ylim=c(0,300), main=”SGP Score Vs SGPSTARRdg”, pch=2, cex.main=1.5, frame.plot=FALSE, col=”green”)

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

View solution in original post

5 REPLIES 5
BhaveshPatel
Community Champion
Community Champion

Hi Micheal

 

You can use R script to get a scatter chart with non aggregated values. The script is simple.

 

You should create your dataset by dragging the fields into the values area and write the below script.


plot(dataset$SGPScore, dataset$SGPSTARRdg, xlab=”SGP Score”, ylab=”SGPSTARRdg”, xlim=c(0,300), ylim=c(0,300), main=”SGP Score Vs SGPSTARRdg”, pch=2, cex.main=1.5, frame.plot=FALSE, col=”green”)

Thanks & Regards,
Bhavesh

Love the Self Service BI.
Please use the 'Mark as answer' link to mark a post that answers your question. If you find a reply helpful, please remember to give Kudos.

Hi Bhavesh,

 

Thank you so much for your reply.  I attempted running this R script, but receive the error below. 

 

I'd appreciate any assistance with this, as I have very little experience with R.

 

Michael

 

R Script Error.png

Hi Bhavesh,

 

I was able to write my first R Script.  Thank you for your help.

 

I used: 

 

plot(dataset$SGPScore, dataset$CurrentSGPSTARRdg, xlab="SGPScore", ylab="CurrentSGPSTARRdg", main="SGP Score Vs CurrentSGPSTARRdg", pch=2, cex.main=1.5, frame.plot=FALSE, col="green")

 

Is there a way to have this visual interact with others, where I can click on a datapoint and then use thta to filter on a table?

 

Thanks!

 

Michael

Anonymous
Not applicable

Scatter plots on Power BI require a measure on each axis - you can't use just columns.  Workarounds are discussed in this thread: https://community.powerbi.com/t5/Desktop/Scatter-plot-summarizing-data/td-p/37229

 

You can vote to have this issue addressed on this idea, and maybe others: https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/9784617-ability-to-put-categorica...

Steve,

 

Thank you for your reply.  I have voted on the forum.

 

Michael

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.