Create Hierarchy in Power BI

Power BI Hierarchies provide you with the drill down action to the reports. Let me show you how to Create hierarchy in Power BI reports with an example.

How to Create Hierarchy in Power BI

To demonstrate the creation of hierarchies in Power BI, we are going to use the table that we created in the Combine Multiple Tables article.

Create Hierarchy Example 1

There are a couple of ways to create a hierarchy

The first approach to Create Hierarchy in Power BI

To create a new hierarchy in Power BI, Drag and drop one field on to the other. It automatically creates a Hierarchy for you. To demonstrate the same in Power BI, we are dragging the product subcategory onto the product category field.

Drag Fields to Create Hierarchy 2

Now you can see the newly created hierarchy.

Newly Create Hierarchy by dragging dimensions 3

The first approach to add fields to a Power BI hierarchy

Drag and drop the required field to the newly created hierarchy. Let me drag the color field.

Add Fields to Hierarchy 4

Now you can see the Color field inside the Hierarchy.

Create Hierarchy in Power BI 5

The second approach to add fields to a Power BI hierarchy visual

Please select the field that you want to add (let me select product), and right-click on it will open the context menu. Select the Add to Hierarchy, and then select the name (Product Category)

Add to Hierarchy Option in Desktop 6

Now you can see the Product under the hierarchy.

Add Fields to Hierarchy in Power BI 7

Change Hierarchy Levels in Power BI

Please be careful while configuring the hierarchy levels. For instance, if you have the State column above the Country, then Level 1 is State, level 2 is the Country.

Please select the field that you want to change the position or level. Next, right-click on it and select the Move Up option (or move down) from the context menu. Alternatively, you drag and drop the field at the required position.

Change Hierarchy Level by Move Up or Down 8

Now you can see the product at the third position

Create Hierarchy in Power BI 9

Rename Hierarchy in Power BI

Please select the Hierarchy that you created, and right-click on it will open the context menu. Select the Rename option from the context menu. Alternatively, you can double-click on the name

Rename Hierarchy 10

Let me rename it as the product

Create Hierarchy in Power BI 11

Now you can see the new name

Create Hierarchy in Power BI 12

Delete Hierarchy in Power BI

Select the Hierarchy that you delete, and right-click on it open the context menu. Please select the Delete option from the context menu.

Delete Hierarchy 13

Click on the Delete button to confirm the delete operation.

Delete Hierarchy in Power BI 14

The second approach to create Hierarchy in Power BI

Please select the filed that you want to use in it, and right-click on it will open the context menu. Select the New Hierarchy option from the context menu.

New Hierarchy option in Desktop 15

It creates a new one for you.

Newly Created Hierarchy in Power BI 16

Let me add a few more fields

Add Fields to Newly Created Hierarchy in Power BI 17

Delete Fields from Hierarchy

Please select the field that you want to remove or delete from the hierarchy. Next, right-click on it and Delete option from a context menu.

Delete Fields from Hierarchy in Power BI 18

Click the delete button to delete the Color field from it.

Delete Hierarchy Level 19

You can see the same in the below screenshot

Create Hierarchy in Power BI 21

Again, we added the Color field and renamed it as the Product Information.

Create Hierarchy in Power BI 21