Creating hierarchies

Hierarchies are powerful features of Power BI that allow data to be summarized but allow report viewers to drill down into the data to obtain additional details. Similar to groups, we can also create ad hoc hierarchies as well as define hierarchies within our data model. The easiest way to see an ad hoc hierarchy is to use a Matrix visualization, as follows:

  1. Click on a blank area of the canvas and choose Location from the People table.
  2. Switch the visualization from a Table visualization to a Matrix visualization. Some visuals work well with hierarchies, while others do not. Table visualizations are not particularly suited for use with hierarchies, while Matrix visualizations are.
  3. Drag the Division column from the Hours table into the Rows area in the VISUALIZATIONS pane. Note that several arrow icons appear above/below our Matrix visualization.
  4. Drag Hours from the Hours table into the Values area of the Matrix visualization. Use the forked arrow above our Matrix visualization to Expand all down one level in the hierarchy. We can now see the reported hours broken down by Location and Division in our matrix.

We can also define hierarchies as part of our data model. However, unlike the previous case, where we created an ad hoc hierarchy from columns in separate tables, hierarchies that are created as part of the data model must have all of the columns in the hierarchy come from the same table.

Follow these steps to create a hierarchy within the data model:

  1. Expand the Hours table.
  2. Right-click Division and then choose New hierarchy. A Division Hierarchy element will be created within the Hours table, just below our Division column. Note that Division is the first element within our new hierarchy.
  3. Click on the JobID column and drag and drop this column onto the Division Hierarchy. JobID will be added below Division within our hierarchy.

Follow these steps to see our new hierarchy in action:

  1. Click on the blank area of the canvas and then click on Division Hierarchy.
  2. Switch the created visual from a Table visualization to a Matrix visualization.
  3. Add Hours to the Values area.
  1. Use the forked arrow icon for this new Matrix visualization to Expand all down one level in the hierarchy. We can now see our hours broken down by Division and JobID.

Defining hierarchies within the data model is a convenient way to save time. It does this by creating reusable hierarchies of information that can be used within multiple visualizations. 

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.195.128