Microsoft Power BI Complete Reference
上QQ阅读APP看书,第一时间看更新

Bar and Column charts

Both the Bar and Column charts are very similar in setup and how they visual data. The only difference here will be the orientation:  the Bar chart uses rectangular bars horizontally where the length of the bar is proportional to the data, while the Column chart displays the bars vertically, but both are used to compare two or more values. Both of these visualizations have three different formats; Stacked, Clustered, and 100% Stacked. For our example, we will focus on the Bar chart, but users can easily switch over to the Column just with the click of a button.

There are some situations where the  Bar chart will better display data, and the same thing can be said of the  Column chart. The biggest limitation for the  Column chart would be the limited space on the x-axis where the category would go. So, if you have a lot of data labels or if they are very long, you may find that the  Bar chart is the better option. An example where you might choose the  Column chart over the  Bar chart is if your dataset contains negative values. In a  Bar chart, the negative values will show on the left side while in a  Column chart they will display on the bottom. Users generally associate negative values with a downward direction.

Let's look at, setting up the visual:

  1. Select the Stacked Bar Chart option and move and resize the visual to take up a quarter of the report canvas.
  2. The first field we will want to select is Sales Territory Country; this should populate in the Axis area.
  3. Next, let's add our Profit measure, which should populate in the Value section.

Just with these two fields, we can very easily comprehend which countries make the most profit and which makes the least. As you can see though, there are more sections of the Fields Area that we can supply values for, namely the Legend section. By adding a category to this area, we can add sections to our original category, which shows the countries. Let's go ahead and add the Age Breakdown column to the legend for this visual (see Figure 5-10). Just like that, we have a very exciting display of our company's profit broken down by country and age group. Users can now hover over any section of the bar chart and the tooltip will display the values for that specific section. There is, though, another great format option that we can enable to make it even easier to understand the data, and it is called Data Labels. To enable this, simply select the Format Area and you will see an option called Data Labels that can be toggled on and off. By turning this option to On, we now can see the profit breakdown for each country by age category, as seen in Figure 5-10:

Figure 5-10

In regards to the other two options, Clustered and 100% Stacked, you can simply select those visuals to experience the different presentations. You will notice the Data Labels remain and add great value regardless of the visual selection. As well with the addition of the Legend, we have another way to do interactive filtering.