Tutorial: Create a decomposition tree with a Power BI sample

APPLIES TO: Power BI Desktop Power BI service

In this tutorial, you start with a built-in Power BI sample dataset and create a report with a decomposition tree, an interactive visual for ad hoc exploration and conducting root cause analysis. It's also an artificial intelligence (AI) visualization, so you can ask it to find the next category, or dimension, to drill down into based on certain criteria.

Screenshot showing the completed decomposition tree. This tutorial shows you how to:

  • Sign up for a Power BI license, if you don't have one.
  • Import the Retail Analysis sample and add it to the Power BI service.
  • Create a decomposition tree.
  • Do root cause analysis on your data in the decomp tree in Edit mode.
  • Save the report and continue root cause analysis in reading view.

If you want to familiarize yourself with the built-in sample in this tutorial and its scenario, see Retail Analysis sample for Power BI: Take a tour before you begin.


Import the sample in the Power BI service

  1. Open the Power BI service (app.powerbi.com), sign in, and open the workspace where you want to save the sample.

    If you don't have a Power BI Pro or Premium Per User (PPU) license, you can save the sample to your My Workspace.

  2. Select Get data at the bottom of the nav pane.

    Screenshot showing the Get data button.

    If you don't see Get Data, expand the nav pane by selecting the following icon at the top of the pane.

    Screenshot showing the nav pane icon.

  3. On the Get Data page that appears, select Samples.

  4. Select Retail Analysis Sample > Connect.

Create a report from the dataset

On the Datasets + dataflows tab, you have several options for exploring your dataset. In this tutorial, you're going to explore the dataset by creating your own report from scratch.

Screenshot showing the Retail Analysis Sample dataset entry.

  1. Select More options (...) > Create report.

    Screenshot showing the Create report menu item.

    The dataset opens in report editing mode.

    Screenshot showing a brand-new report in edit mode.

Create a decomp tree

Let's add a decomposition tree, or decomp tree, to our report for ad hoc analysis.

  1. Open Power BI Desktop and load the Retail Analysis Sample. You can get this sample from Download original sample Power BI files.

  2. Select the Report icon to open the Reports view. In the Visualizations pane, select the Decomposition tree icon.

    Screenshot showing the Visualizations pane with Decomposition tree selected.

  3. Drag the edge so it fills most of the page. Decomposition trees can get wide.

    Screeshot showing the resized decomposition tree.

  4. Decomp trees analyze one value by many categories, or dimensions. Expand Sales > This Year Sales and select Value. Power BI adds Value to the Analyze box.

    Screenshot showing Value for This Year Sales added to the Analyze box for the decomposition tree.

  5. Next, select dimension fields and add them to the Explain by box. Add as many as you want, in any order. You can use them or not, in any order, in the decomp tree. We added:

    • District Manager
    • Category
    • FamilyName
    • Segment
    • Chain
    • PostalCode
    • Store Type
    • Territory

    Screenshot showing the fields added to the Explain by box.

Analyze in the decomp tree

Now comes the ad hoc analysis part.

  1. Select the plus sign (+) next to This Year Sales and select High value. That means Power BI will use artificial intelligence to analyze all the different categories in the Explain by box, and pick the one to drill into to get the highest value of the measure being analyzed.

    Screenshot showing High value selected for analysis.

    Power BI selects Store type.

    Screenshot showing Store Type selected by Power BI.

  2. Keep selecting High value until you have a decomp tree that looks like this one.

    Screenshot showing all the highest values selected by Power BI.

    Or select other values yourself, and see what you end up with.

  3. You can delete levels by selecting the X in the heading.

    Screenshot showing how to delete a level from the decomposition tree.

  4. Save your report. Now anyone who views your report can interact with the decomp tree, starting from the first This Year Sales and choosing their own path to follow.

    Screenshot showing the decomposition tree with the options available for This Year Sales.

Learn about everything else you can do with decomp trees in Create and view decomposition tree visuals in Power BI.

Next steps

More questions? Try the Power BI Community