Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
JRA21_13_19_25
Frequent Visitor

Decomposition Tree - How should I structure my data?

I would like to create a Decomposition Tree like in the diagram below which shows how different users navigate through a website.  

 

Decomposition Tree Diagram.png

 

 

I have dimension tables called dim_webpagejourney, dim_webpagecategories and dim_userlocation and a fact table called fact_webpagejourney as shown below. I want to know how I can create the above decomposition tree using these tables. Also in the dashboard I want to have separate filters for the web page categories as shown in the image above which corresponds to each PageViewOrderRank. If I need to restructure my dim and fact tables to achieve this, how can I do this? 

 

Note: The PageViewOrderRank field corresponds to the order in which a user has viewed the webpages e.g. 1 is the 1st page viewed, 2 is the 2nd page viewed etc. 

 

Many thanks for the help in advance. 

 

dim_webpagejourney:

UserIDWebPageCategoryIDUserLocationIDPageViewOrderRank
1341
2251
2152
3551
4551
5741
5142
5243
5144
5645
6521
7311
81231
8832
8833
9331
9132
9333
9234
9235

 

 

dim_webpagecategories :

WebpageCategoryIDWebpageCategoryName
1Homepage
2Company Policies
3Contact Us
4History
5FAQ
6Merchandise Shop
7Home Goods
8Bathroom Products
9Garden Tools
10Clothing
11Shoes and Accessories 
12Refunds

 

dim_userlocation:

UserLocationIDLocation
1UK
2Spain
3USA
4Germany
5South Africa

 

fact_webpagejourney:

 

DateIDTimestampUserIDCount_of_Views
2024052217:59:3711
2024071706:32:0921
2024071706:33:3621
2025041416:27:0331
2024010516:34:1141
2024010407:32:2951
2024010407:34:2451
2024010407:34:4851
2024010407:36:0951
2024010407:36:3951
2024011109:23:2961
2024010213:51:0771
2024010601:45:3481
2024010601:45:4981
2024010601:47:2881
2024010219:06:5391
2024010219:07:5491
2024010219:08:3291
2024010219:08:4791
2024010219:11:3891

 

 

 

1 ACCEPTED SOLUTION
freginier
Super User
Super User

If I understood well your request, you need to follow these steps :

Step 1: Get the Sankey Diagram Visual

Power BI's native "Decomposition Tree" isn't suitable for sequential flows. You'll need a Sankey diagram custom visual.

  1. Open Power BI Desktop.
  2. In the Visualizations pane, click the ellipsis (...) and select "Get more visuals."
  3. Search for "Sankey Diagram" in the marketplace.
  4. Choose a visual (e.g., "Sankey Diagram by MAQ Software") and click "Add."
  5. The Sankey icon will now appear in your Visualizations pane.

Step 2: Create the Sankey Diagram

  1. Click the Sankey Diagram icon to add it to your report page.
  2. In the Visualizations pane's field wells, drag your data:
    • Source: FromWebpageCategoryName
    • Destination: ToWebpageCategoryName
    • Weight: Create a new measure:
       
      Distinct User Count = DISTINCTCOUNT(UserJourneyPaths[UserID])
      Drag this Distinct User Count measure to the Weight field.
  3. Your Sankey diagram will now display the flow of users between page categories.

Step 3: Implement Filters

You want separate filters for each page rank's category, along with a global location filter.

A. Global Filter

  1. Add a Slicer visual to your report.
  2. Drag the Location column from your UserJourneyPaths table to the Slicer's field well. This filters the entire Sankey by user location.

B. Page-Specific Category Filters (for "Category Page 1", "Category Page 2" etc.)

You have a few options to achieve this filtering:

  1. Recommended: Leveraging Sankey Interactivity (Simpler & More Intuitive)

    • No extra slicers needed for categories at specific ranks.
    • Simply instruct users to click directly on any node (webpage category) within the Sankey diagram. Power BI will then highlight or filter the paths connected to that node, allowing users to explore the flows originating from or leading to that specific category at its position in the journey. This is often the most natural way to filter a flow diagram.
  2. Alternative: Multiple Slicers for Each Rank's Category (More Direct Control)

    • This provides explicit slicers for each page rank, but requires more setup and can become complex for many ranks.
    • Add a Slicer visual.
    • Drag FromWebpageCategoryName to the slicer's field well.
    • Crucial Step: With this slicer selected, go to the Filters pane. Add a visual-level filter on FromPageViewOrderRank with a value of 1. This ensures the slicer only shows categories for the first page view. Label this slicer "Page 1 Category."
    • Repeat: For "Page 2 Category," add another slicer, drag ToWebpageCategoryName to it, and apply a visual-level filter on ToPageViewOrderRank with a value of 2. Continue this for additional ranks as needed.
    • Manage Interactions: Select your Sankey diagram. Go to "Format" > "Edit interactions." For each "Page X Category" slicer, ensure the filter icon is selected for the Sankey visual.

Step 4: Formatting & Refinement

  1. Titles & Labels: Add clear titles for your report and the Sankey. Ensure node labels are readable.
  2. Data Labels: In the visual's "Format" options, enable and customize data labels to show Distinct User Count on nodes/links.
  3. Colors & Tooltips: Adjust colors for clarity. Customize tooltips to display relevant flow information.
  4. Layout: Arrange the Sankey and slicers logically on your report page.

Step 5: Test & Publish

  1. Test Thoroughly: Interact with all filters and click on nodes to ensure the diagram responds correctly.
  2. Performance: Monitor performance for large datasets; optimize if necessary.
  3. Publish: Once satisfied, publish your report to the Power BI Service for sharing.

By completing these steps, you should be able to have the desired tree to monitor websites navigation.

View solution in original post

2 REPLIES 2
freginier
Super User
Super User

If I understood well your request, you need to follow these steps :

Step 1: Get the Sankey Diagram Visual

Power BI's native "Decomposition Tree" isn't suitable for sequential flows. You'll need a Sankey diagram custom visual.

  1. Open Power BI Desktop.
  2. In the Visualizations pane, click the ellipsis (...) and select "Get more visuals."
  3. Search for "Sankey Diagram" in the marketplace.
  4. Choose a visual (e.g., "Sankey Diagram by MAQ Software") and click "Add."
  5. The Sankey icon will now appear in your Visualizations pane.

Step 2: Create the Sankey Diagram

  1. Click the Sankey Diagram icon to add it to your report page.
  2. In the Visualizations pane's field wells, drag your data:
    • Source: FromWebpageCategoryName
    • Destination: ToWebpageCategoryName
    • Weight: Create a new measure:
       
      Distinct User Count = DISTINCTCOUNT(UserJourneyPaths[UserID])
      Drag this Distinct User Count measure to the Weight field.
  3. Your Sankey diagram will now display the flow of users between page categories.

Step 3: Implement Filters

You want separate filters for each page rank's category, along with a global location filter.

A. Global Filter

  1. Add a Slicer visual to your report.
  2. Drag the Location column from your UserJourneyPaths table to the Slicer's field well. This filters the entire Sankey by user location.

B. Page-Specific Category Filters (for "Category Page 1", "Category Page 2" etc.)

You have a few options to achieve this filtering:

  1. Recommended: Leveraging Sankey Interactivity (Simpler & More Intuitive)

    • No extra slicers needed for categories at specific ranks.
    • Simply instruct users to click directly on any node (webpage category) within the Sankey diagram. Power BI will then highlight or filter the paths connected to that node, allowing users to explore the flows originating from or leading to that specific category at its position in the journey. This is often the most natural way to filter a flow diagram.
  2. Alternative: Multiple Slicers for Each Rank's Category (More Direct Control)

    • This provides explicit slicers for each page rank, but requires more setup and can become complex for many ranks.
    • Add a Slicer visual.
    • Drag FromWebpageCategoryName to the slicer's field well.
    • Crucial Step: With this slicer selected, go to the Filters pane. Add a visual-level filter on FromPageViewOrderRank with a value of 1. This ensures the slicer only shows categories for the first page view. Label this slicer "Page 1 Category."
    • Repeat: For "Page 2 Category," add another slicer, drag ToWebpageCategoryName to it, and apply a visual-level filter on ToPageViewOrderRank with a value of 2. Continue this for additional ranks as needed.
    • Manage Interactions: Select your Sankey diagram. Go to "Format" > "Edit interactions." For each "Page X Category" slicer, ensure the filter icon is selected for the Sankey visual.

Step 4: Formatting & Refinement

  1. Titles & Labels: Add clear titles for your report and the Sankey. Ensure node labels are readable.
  2. Data Labels: In the visual's "Format" options, enable and customize data labels to show Distinct User Count on nodes/links.
  3. Colors & Tooltips: Adjust colors for clarity. Customize tooltips to display relevant flow information.
  4. Layout: Arrange the Sankey and slicers logically on your report page.

Step 5: Test & Publish

  1. Test Thoroughly: Interact with all filters and click on nodes to ensure the diagram responds correctly.
  2. Performance: Monitor performance for large datasets; optimize if necessary.
  3. Publish: Once satisfied, publish your report to the Power BI Service for sharing.

By completing these steps, you should be able to have the desired tree to monitor websites navigation.

Thank-you for the advice, that's helpful feedback. 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.