Join Gini von Courter for an in-depth discussion in this video Creating a scatter chart, part of Power BI Features in Depth.
- View Offline
ScatterAndBubbleCharts is more world data. In this case, I've used Power Query to create one table that includes the country and region, the year, the total populations, that's some data we've been working with for a while, the income per person, and the life expectancy at birth. I have the beginning of a Power View report. I've created a table and added country, income per person, and total population.
I've also added a couple of filters so that we're only looking at one region's worth of data, rather than all the data, and one year's worth of data, 2001. Now what I'd like to do is insert one of those other charts. Specifically, I'd like to insert a scatter chart. When I choose Scatter, what it does is it uses the two numbers that I have to be able to create a plot of points on the X and Y axes. So, total population in millions, and income per person in thousands.
If I wish, I could also look at, for example, Europe at the same time. And it, it gets a little confusing, but if I say, you know what, color it by region. So I can drag region to the color area. And now I can see Europe in purple and South America in blue. And broadly what I can say is that the income per person is higher in Europe at this particular time. And the total population tends to be a little higher, although if you look at a country like Brazil, it's got a much higher population than the next highest country on the chart, which is Russia in Europe.
So this is what it looks like when I create a scatter chart. I'm going to give this chart a little bit more room. There's not a lot I can do here in terms of formatting, and I sure wish there was, but these are basically data points and, so I get purple and blue. If I add another region, I'll get another color. Red's kind of nice, I wish I'd gotten it earlier on, but I didn't. What I want to do now is add another data series. I'm looking already at total population, and I'm looking at, income per person.
I want to take total population and move it to what's called the size, or Z axis. And I'm going to move life expectancy to the Y axis. This now get's to be very, very interesting because what I have is I have a plot that is called a bubble chart. The difference between a bubble chart and a scatter chart is that a scatter chart uses two data points and a bubble chart's using three. On the X axis we have income per person in thousands. On the Y axis we have life expectancy at birth.
And the size of the circle is our third variable, which is total population. So this is pretty cool. I can say I want to just look at Europe. And here are the countries of Europe, based on their size. Based on their income, and based on their life expectancy. Now let's add Sub-Saharan Africa, and we begin to see some real patterns. Income, clearly, life expectancy as well. Let's swap in Asia, look at the size of the bubbles.
BEcause those are the size of the countries. So here we have our huge countries, China, India, Japan, Brunai. Now, there's one more thing we can do with the scatter. We have the ability to have a play axis. And that has to be timed. So if I drag Year down here, and clear Year off of my filters. Now we can play this and actually watch the data change. So, let's make it easy to begin with, let's just use North America, because we have four whole countries.
It gets pretty easy. And you'll notice, life expectancy increasing. Income increasing. The size of the country is not increasing quite as fast. I mean, the United States gets bigger, and bigger. Mexico, bigger and bigger. Not bad. Now, let's add Europe. Luxemburg really took off there at the end in terms of increases in income and increases in life expectancy. So we can use our filters in order to look at different slices of data.
And let's see how this is all put together again. We have our income, here on the X axis. We have our life expectancy at birth on the Y. We could switch those if we wish. And we have our total population, the size of our bubble. The details are the country. The region is providing the colors. And this needs to be something that you don't have a lot of different categories, you wouldn't want to use for example, countries for color in this. It won't allow more than 20, and if it's more than just a handful it's very difficult.
And then if we have a chronological column like year, or even it can just be a time column. I can use that as my play axis. This is a bubble chart. And it's really a very exciting type of chart to look at. We could get very granular with this. We could allow our users, for example, to look at specific countries. So they might want to, for example, look just at Austria and play Austria. Where life expectancy went up before income started to go up.
Add another country, Czech Republic. Remember it, we still have regions here. If we choose to add some countries that aren't in Europe, we would have dome different colors for them. So we have North America and let's add Mexico. And now Play. So, income is higher in the Czech Republic and in Austria than it is in Mexico, but it looks like life expectancy in Mexico is at least as high as it is in the Czech Republic. It's not bad, we can look at that data directly of course, 7706, life expectancy.
7741, very close. To summarize, if you have two columns of data, you can plot them on a scatter chart. If you have three columns, you can plot them on a bubble chart. And if you have three columns of data and another column that you can use for categorization, then you can color your bubbles. If you have yet another column of data that's time based data, you can play your bubble chart to show a history of those variables.
- Understanding data analysis and business intelligence
- Installing Office BI add-ins
- Searching for online data with Power Query
- Shaping data in the Query Editor
- Connecting to data sources
- Modeling data with Power Pivot
- Enhancing PivotTables and PivotCharts with PowerPoint
- Visualizing geospatial data with Power Map
- Creating and formatting Power View reports
- Sharing your data using Power BI for Office 365