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

Interactive filtering

Almost every single visual that is readily available to us within Power BI has some sort of element that users can interact with. At the same time, every visual can be impacted by these very same elements. This really gives us a lot of room when it comes to deciding which visuals we would like in a report page. We will cover Interactive filtering again later on in this chapter, but it is important to understand how this feature works so that we can leverage it throughout the following examples. Let's create two very simple visuals based off our current data model so we can see exactly how this interactive filtering works. For right now, let's not worry about the details of these visuals as they will be fully described in later sections of this chapter.

Let's look at, setting up the example:

  1. Select the Stacked Column Chart visual that will appear in the report canvas. Make sure you can see the anchor points we talked about earlier so that the following steps will work.
  2. Now, let's add a couple of fields to the visual. In the Fields pane under the Internet Sales table, choose the Total Sales calculated measure by placing a check in the box to the left. You will notice that the field shows up under the Value section of the Field area.
  1. Do the same thing for the Sales Territory Country field located under the Sales Territory table. This time, the field shows up under the Axis section of the Field area. Reference figure 5-3 here to validate that everything is set correctly:
Figure 5-3
You may notice that some of the visual elements do not meet your standards. For example, the size of the text for various items in this visual are far too small to read. These are the types of changes that we would make in the Format area but will not be doing in this specific example. We will be examining the most common Format changes for each of the visuals within their respective section in this chapter. Right now, we just want to see how interactive filtering works.
  1. We can already start to interact with any of the columns we currently have, but since this is the only visual it really isn't that exciting. So, let's add another visual to the report canvas; make sure you left-click somewhere in the empty space so that no visual is currently selected.
  1. Now, we can select the Pie Chart visual, which will be added to the report canvas. You may have to move the visual to a location more to your liking.
  2. We will now add two fields to this visual, and the first will be the Age Breakdown calculated column. We can either place a check in the box next to the field, or we can drag that field on top of the correct visual; both methods will have the same effect and we should see the Age Breakdown field located under the Legend section.
  3. Using either of the two methods just described, let's add the Profit calculated measure to this visual as well, which should populate under the Values section. See figure 5-4 to verify the setup. Remember, don't worry about formatting right now:
Figure 5-4

Now that the example is all set and there are two visuals in the report canvas, we can really see how interactive filtering works. Go ahead and select (left-mouse-click) the column labeled United States in the stacked column chart. You will immediately see that the pie chart changes to having a much smaller highlighted area. By hovering over the 35-44 section of the pie chart, we can now see that the United States makes up $413,617.35 of the $1,661,776.43 total for that category. This same type of filtering can be done by the pie chart, which will then affect the stacked column chart. Just with this simple example, you can see how effective interactive filtering is in answering questions about our data. Keep this in mind as we move forward with our other examples so you can keep seeing the impact this filtering has. We will cover additional option settings around interactive filtering at the end of this chapter.