To build a hierarchy in Power BI, you take several related columns (such as Country, Region, City, Store) and group them into one field you can drill through. The quickest route is to use a proper date table or a set of columns in a single table, then drag them onto each other in the Fields pane: drag City onto Region, and Region onto Country, until they stack into one collapsible field. Alternatively, right-click a column in the Data view and choose New hierarchy, then add columns to it via Add to hierarchy. A well-built hierarchy lets report readers expand, collapse and drill down from summary to detail with a single click.

The term "hierarchy table" usually means one of two things: a hierarchy built from columns inside an existing table, or a dedicated table that stores parent-child relationships (for example an account chart or an employee reporting structure). This guide covers the column-based hierarchy, which is what most Power BI reports need, and explains the parent-child variant where it applies. Menu labels can differ slightly by Power BI Desktop version and region, so look for the closest match if a wording differs.

What You'll Need

  • Power BI Desktop installed (the free version is enough to build hierarchies; publishing needs a Power BI account).
  • A data model with the columns you want to nest, ideally in a clean dimension table rather than mixed into a fact table.
  • Consistent values in each level: no blanks where a parent is expected, and no duplicate spellings such as "USA" and "US".
  • A basic understanding of how the Fields pane lists tables and columns on the right of the report canvas.

Step-by-Step

  1. Load your data. Connect to your source through Home > Get data, then check the columns in the Data view (the table icon on the left edge). Confirm that each level you want lives in its own column and that the values are consistent.
  2. Clean the levels first. In Power Query, trim spaces, fix inconsistent casing and replace blanks if a level must always have a value. Building a hierarchy on messy data produces empty drill levels that confuse readers.
  3. Create the hierarchy from the Data view. Select the top level column, right-click it and choose New hierarchy. A new item appears in the Fields pane with the column name and a small hierarchy icon.
  4. Add the remaining levels. Right-click the next column and choose Add to hierarchy, then pick the hierarchy you just created. Repeat for each lower level. You can also drag columns directly onto the hierarchy name in the Fields pane, which usually prompts Power BI to place them in order.
  5. Order the levels correctly. In the Fields pane, drag levels up or down inside the hierarchy until the broadest level is on top and the most granular is at the bottom. The drill order follows this stack.
  6. Rename it. Right-click the hierarchy and choose Rename. Call it something a report reader will understand, such as "Geography" or "Product Category".
  7. Use it in a visual. Add the hierarchy to a matrix or bar chart. In a matrix, put it in the Rows well and the visual shows expand and collapse chevrons automatically.
  8. Check the drill controls. In the top-right corner of a visual you can see drill icons: expand one level down, go to the next level, expand all down one level, and drill up. Position your mouse over them to read the tooltips, since the icons are unlabelled.
  9. Set the default expansion level. Right-click the visual and choose Expand to next level to open it one step further by default, so readers see a useful starting view instead of a single total.
  10. Sort each level sensibly. Select a column and use Sort by column in the ribbon or column tools to sort a month name by a month number, or a priority label by its numeric rank. Without this, levels sort alphabetically.
  11. Publish and test. Use Home > Publish. Open the report in the service and click through the expand and collapse arrows on each level to confirm the drill paths behave as expected for anyone viewing it.

If you need a parent-child hierarchy instead, the usual approach is a table with an ID column and a ParentID column. You can relate it to itself and use DAX path functions such as PATH and PATHITEM to flatten levels into usable columns, or add a calculated column that builds a delimited path string. This is more advanced and slower to model; use it only when the depth is variable, such as a chart of accounts.

Common Mistakes

  • Building the hierarchy on fact-table columns. Transaction columns rarely contain clean levels. Build hierarchies on dimension tables and relate them.
  • Leaving blank or unmatched values. One blank city under a country creates a visible empty group at that level. Fix it in Power Query.
  • Duplicating levels. Placing both a quarter and a month in a hierarchy when the date table already handles both can double-count if relationships are wrong.
  • Sorting alphabetically by accident. Month names sorting as April, August, December makes a hierarchy look broken even when it is built correctly.
  • Forgetting that visuals respect relationships. A hierarchy in the wrong table with no relationship to the fact table returns a single blank row.

Tips

  • Use a proper marked date table rather than dragging date parts from a fact table; Power BI then handles drill-down through year, quarter, month and day automatically.
  • Keep level names short. Matrix column headers truncate long names and readers lose track of which level they are on.
  • Add tooltips or a text box explaining the hierarchy for readers who only ever see the published report.
  • Hide individual columns that are only used inside a hierarchy so the Fields pane stays tidy for report authors.
  • Name hierarchies after the concept (Geography, Organisation, Product) rather than the top column, so future changes do not make the name wrong.

Troubleshooting

  • No drill arrows appear. Confirm the hierarchy, not a single column, is in the visual's well. Only hierarchies and date fields show the expand and collapse chevrons.
  • Drill shows blank rows. The level above or below has missing values or a broken relationship. Check for blanks and verify the relationship direction in the Model view.
  • Hierarchy icon missing from the Fields pane. It may be collapsed inside a table; expand the table arrow. If it is still absent, the columns are in different tables with no relationship, so Power BI cannot nest them.
  • Adding a column fails. Some calculated columns of certain types cannot join a hierarchy. Create the hierarchy from physical columns in the table.
  • Sort order is wrong. Use Sort by column on the text column, pointing it at a numeric or date key. If that fails, refresh and check the key column contains no blanks.
  • The report in the service behaves differently. Clear the browser cache, sign out and back in, and republish. If only some readers see odd behaviour, check that they are viewing the latest version of the report.

Frequently Asked Questions

Do I need a separate table for a hierarchy?

No. Most hierarchies are simply several columns grouped in one table. A separate parent-child table is only needed when depth varies or the structure changes often.

Can a hierarchy span more than one table?

Not directly. Power BI hierarchies are built inside a single table. Relate the tables in Model view, or create a flattened dimension table in Power Query.

Why are my drill arrows greyed out?

Usually because the visual holds a single column rather than a hierarchy, or the hierarchy has only one level. Check the Fields pane configuration.

Can readers drill on mobile?

Yes, in the Power BI mobile app you tap a data point and use the expand option to move through levels, though the layout differs from the desktop canvas.

Does a hierarchy change my DAX measures?

No. A hierarchy is a presentation grouping; measures still evaluate against the underlying columns and relationships.