Sub topic 8
Exploring relationships with scatter and bubble charts
Bar and line charts show how one measure changes across categories or time. A scatter chart answers a different question: do two measures move together? This chapter covers how scatter and bubble charts are built, how to read them, and where they mislead.
This chapter assumes you can build a basic visual in Power BI Desktop and write simple measures. It also assumes your model has a Sales fact table related to Product, Customer and 'Date' tables.
What a scatter chart shows
A scatter chart plots each item as a dot. The horizontal position comes from one numeric measure and the vertical position from another. Patterns in the cloud of dots tell you about the relationship:
- Dots rising from lower left to upper right suggest a positive relationship.
- Dots falling from upper left to lower right suggest a negative relationship.
- A shapeless cloud suggests little or no relationship.
- Dots far from the rest are outliers worth investigating.
A bubble chart is a scatter chart with a third numeric measure mapped to dot size. In Power BI they are the same visual. When you drop a field into the Size well, the scatter chart becomes a bubble chart.
Field wells
The wells matter more here than in most visuals, because the Values well sets what each dot represents.
| Well | Purpose | Typical content |
|---|---|---|
| Values | One dot per distinct value of this field | Product name, customer, store |
| X Axis | Horizontal position | A numeric measure |
| Y Axis | Vertical position | A numeric measure |
| Legend | Colors dots by category | Product category, region |
| Size | Dot area (bubble chart) | A third numeric measure |
| Play Axis | Animates dots across values | Year or month |
| Tooltips | Extra fields shown on hover | Any measure |
If you leave Values empty, Power BI aggregates everything into a single dot. This is the most common beginner error with this visual. Put a categorical field such as Product[ProductName] in Values to get one dot per product.
Measures for the axes
Both axes need numeric values. Rather than relying on implicit aggregation of columns, create explicit measures. These assume Sales[Quantity] and Sales[CustomerKey] columns exist, and reuse [Total Sales] from earlier chapters:
Total Sales = SUM ( Sales[SalesAmount] )
Units Sold = SUM ( Sales[Quantity] )
Avg Price per Unit =
DIVIDE ( [Total Sales], [Units Sold] )
Customer Count =
DISTINCTCOUNT ( Sales[CustomerKey] )A scatter of [Avg Price per Unit] (X) against [Units Sold] (Y), with one dot per product, shows whether higher-priced products sell fewer units. Putting [Total Sales] in Size adds the revenue each product contributes.
Use DIVIDE for ratio measures. A product with zero units returns a blank instead of an error, and blank values are left off the chart rather than distorting it.
Choosing the level of detail
The grain of Values controls how many dots you get and what they mean.
- Too coarse, such as 4 categories, gives too few dots to see any relationship.
- Too fine, such as every transaction, gives an unreadable cloud.
- A good range is roughly 15 to a few hundred dots, each of which is a meaningful entity such as a product, store or customer segment.
For very large point counts, Power BI applies high density sampling, which samples the data to keep the chart readable and fast. The visual still represents the overall shape, but a given dot may not be drawn. Check the sampling setting in the format pane if an expected outlier is missing.
When to add a third dimension
Add Size only when the third measure answers a real question, such as "which products with high price and high volume also drive the most revenue?" Size is a weaker visual channel than position. People judge the area of circles poorly, so use bubbles to show rough magnitude, not exact comparisons.
Use Legend for a categorical split. Limit it to about five or six categories, because many colors are hard to tell apart.
Use Play Axis with a date field to animate how dots move across periods. It suits presentations and exploration. It is a poor choice for a static report, because readers cannot compare two periods at once. For that, use two visuals or a line chart.
Adding analysis aids
The Analytics pane offers tools that make patterns easier to read in a scatter chart. Availability depends on your Power BI version, so check which appear for your visual.
- Trend line fits a line through the dots and shows the overall direction.
- Average, median, min and max lines for each axis split the chart into quadrants. Dots in the upper right are above average on both measures.
- Constant lines mark a fixed target, such as a minimum acceptable margin.
- Symmetry shading and ratio lines help when both axes use the same units.
Quadrant reading is often the most useful. Set average lines for both axes, and the four regions become categories you can discuss, such as "high price, high volume" or "low price, low volume".
Axis scale and outliers
A few extreme values can squeeze most dots into one corner. Two options help:
- Switch the axis to a log scale in the format pane. This suits values that span several orders of magnitude. It does not work with zero or negative values.
- Filter the extreme items out, and say so on the report, or call them out in their own visual.
Unlike bar charts, scatter axes do not have to start at zero. You are judging position and pattern, not bar length, so fitting the axis to the data range is acceptable.
Common mistakes
- Empty Values well. You get one dot. Add a categorical field.
- Summing a ratio. If you drop a ratio column such as a margin percentage into an axis with the default Sum aggregation, the number is meaningless. Write the ratio as a measure with
DIVIDE. - Too many bubbles. Large bubbles overlap and hide each other. Reduce the bubble size in the format pane, add transparency, or filter the data.
- Unequal items. A dot representing 5 transactions sits next to one representing 5,000. The sample size behind each dot is invisible unless you put it in Size or a tooltip.
- Negative size values. Bubble size represents magnitude, so use a non-negative measure. A measure that can go negative gives misleading sizes.
- Unlabeled dots. Turn on category labels for a few key items, or rely on tooltips. Labeling every dot creates clutter.
Interaction with other visuals
Scatter charts cross-filter other visuals on the page. Selecting a dot filters a bar chart or table to that entity. You can also draw a selection around a group of dots to highlight them. This makes a scatter chart a good exploration tool next to a table of details. The table gives exact values and the scatter chart gives the overall pattern.
Exercise
A report has a scatter chart with [Avg Price per Unit] on X and [Units Sold] on Y, but only one dot appears. What is the likely cause, and how do you fix it? Then explain what changes if you add [Total Sales] to the Size well.
Show answer
The Values well is empty, so Power BI aggregates everything into a single dot. Add a categorical field such as Product[ProductName] to Values to get one dot per product. Adding [Total Sales] to Size turns the scatter chart into a bubble chart, where each dot's area reflects that product's revenue, so you can see which price and volume combinations drive the most sales.
Exercise
You want to see whether stores with more customers also have higher average sales per customer. Which two measures would you place on the axes, and which would you put in Values? Write the DAX for the ratio measure.
Show answer
Put [Customer Count] on X and a ratio measure on Y, with Store[StoreName] in Values. The ratio measure is: Sales per Customer = DIVIDE ( [Total Sales], [Customer Count] ). Using DIVIDE avoids errors for stores with no customers.