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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Mina_PowerBI
Regular Visitor

Dynamic Hierarchy in Power BI Decomposition Tree Based on Filter Selections

Objective:

I am working on a Power BI report using a dataset from an Excel file (AM Excel Database), and I would like to implement a dynamic, auto-expanding decomposition tree that adjusts its hierarchy path based on the user’s filter selections.

The goal is to create an interactive and intelligent hierarchy experience where users control the decomposition path simply by selecting values from filters, without manually configuring levels inside the decomposition tree visual.

The dataset contains 10 primary filters (dimensions), which are: Division , DSO Region , KPI Customer Cluster , Country Sold To , Country Ship To, Customer Sold To , Customer Ship To , Customer Payer , Production Plant , Company Code 

Billing Document Num.CustomerCustomer TextPosting DateCollection GroupCollection SpecialistProfit CenterTrading Partner ARTrading Partner AR TextTerms of Payment Key (Days)Country Trading PartnerCompany CodeOrder reasonSales Document TypeCustomer Lead Responsible Group(EO/Region/Division)Customer Lead Responsible Group(EO/Region/Division) TExtCustomer Lead Responsible (SCC)Customer Lead Responsible (SCC) TextRB DivisionPosting keyFI document typeFI document type TextCustomer SegmentRB-Customer GroupRB-Customer Group TextRB-Customer SubgroupRB-Customer Subgroup TextRB Customer (external)RB Customer (external) TextKPI Customer ClusterKPI CustomerDSO RegionTerms of Payment KeyTerms of Payment Key TextSales OrganizationReason code groupReason code group TextReason CodeReason Code TextNet due dateTotal Receivables in Local Currency  
3E+094E+07Thomas, Potts and Lynch2024-02-09agencyDaniel Soto9632718576538Ellis, Gross and Contreras30ML3000cityCRdrawTVMichael JordanJewellery designerhit01DZstrategize front-end partnershipschallengeAuseYgrowth4.99E+08Martinez LLCCluster 1tendNY0001moreSO3RCG2notRC2accept2025-07-2742830.06  
9E+095E+07Johnson Inc2024-05-08stayChristine Higgins47703237372903Hernandez-Adams30AM2000stageCRtypeagoKaren MontoyaCamera operatortrade11DRintegrate killer ROIincludingApastXreceive1.51E+08Rodriguez, Alvarez and OneillCluster 3alreadyRI0002cutSO2RCG1thoseRC2sure2025-08-2934578.66  
1E+091E+07Taylor-Stafford2024-02-05downFernando Jenkins67279044352545Ross, Moreno and Reed60SM3000sellCRCongressmindDwayne GrayRegulatory affairs officermaintain11DRseize B2C technologiesfactBaccordingZhimself3.3E+08Callahan, Wolf and GardnerCluster 1resourceME0002DemocratSO2RCG1tellRC2themselves2025-07-1131233.33  
1E+099E+06Wang, Miller and Peterson2024-07-26eventHolly Armstrong15622018152611King-James45BN3000employeeREagencytalkDr. Adrian MitchellChief Strategy Officerfloor01DZsynergize sticky networksculturalBmethodZbehavior17643277Hull, Owens and KaneCluster 3groundCO0003avoidSO3RCG2lateRC1analysis2025-07-2047950.56  
3E+097E+07Leach LLC2025-03-14whoseKrystal Peterson178052028050Martin-Jordan45PL3000intoREsecondadultJanet OrrAir cabin crewhim40DRincentivize collaborative web servicessimilarBremainZelse9.17E+08Robinson-GardnerCluster 2friendTN0001driveSO1RCG1scoreRC1act2025-08-0542431.79  
9E+098E+07Dennis Group2025-07-06AmericanCatherine Huffman9300313865205Mendoza, Taylor and Grant45MZ4000securityREdifficultdiscoverJessica WardSpeech and language therapistinto40DZorchestrate compelling methodologieshereBotherXcurrent1.73E+08Evans and SonsCluster 3nameTX0001seasonSO3RCG2missionRC1upon2025-07-271862.61  
2E+097E+07Bradley, Young and Walker2024-10-30audiencePaul Castillo63414830516308Mcdonald-Graham30MV1000secondORaccepttaxThomas HoganBiomedical engineerit01DZrepurpose customized mindsharemachineBwearYhouse8.04E+08Woods GroupCluster 2generationIA0001throughoutSO1RCG1aloneRC3structure2025-07-3013366.98  


Challenge : 

  • The decomposition tree hierarchy path should begin with the first selected filter, then proceed to the next selected filter, dynamically — not following a fixed hierarchy.

  • This way, users determine the hierarchy on the fly, based on their filter selections, and the decomposition tree automatically respects this path.

Mina_PowerBI_0-1752238814720.png

 

Request for Help:

Can someone please guide me on how to:

  • Implement this logic in Power BI?

  • Possibly use Field Parameters, dynamic measures, or DAX workarounds to simulate this behavior?

  • Automatically drive the hierarchy expansion of the decomposition tree based on filter selections?





3 ACCEPTED SOLUTIONS
johnbasha33
Super User
Super User

@Mina_PowerBI 

Key Understanding

  • The Decomposition Tree visual in Power BI expects static hierarchies.

  • But Field Parameters (introduced in 2022) allow dynamic selection of columns as dimensions.

  • What cannot be automated directly is:

    • Changing the hierarchy path automatically based on filter selections.

    • Auto-expansion of branches (Power BI still requires user clicks for drill-down).

We can work around this with Field Parameters + slicers.

Step-by-Step Solution

🔧 1. Create a Field Parameter for Dynamic Hierarchy

Go to Modeling > New Parameter > Fields.

Add all 10 dimensions as choices:

Division
DSO Region
KPI Customer Cluster
Country Sold To
Country Ship To
Customer Sold To
Customer Ship To
Customer Payer
Production Plant
Company Code

Rename the parameter as: Dynamic Hierarchy.

This will create:

  • A parameter table (Dynamic Hierarchy)

  • A DAX column called [Dynamic Hierarchy Fields]

A DAX measure like:

Selected Hierarchy = SELECTEDVALUE('Dynamic Hierarchy'[Dynamic Hierarchy Fields])

Use Dynamic Fields in Decomposition Tree

Add the Dynamic Hierarchy field (from the parameter) into the decomposition tree as your hierarchy level.

Add your measure (like Total Receivables, Count of Customers, etc.) to analyze.

⚠️ Note:

  • You can only select one field at a time in decomposition trees.

For multiple levels, the user has to manually expand the hierarchy within the visual, unless you pre-define the field order via slicer control.

Simulate Ordered Path Using a Slicer

To simulate "first this filter, then next," create a multi-select slicer on your Dynamic Hierarchy parameter table.

This allows users to choose the path they want interactively. While Power BI won’t auto-expand based on the slicer, it will enable:

  • Controlled inclusion of fields

Dynamic structure driven by user choice

Optional: Create Custom Table for Slicer Order

If needed, create a custom table to track the sequence of hierarchy (using a ranking mechanism):

HierarchyOrder =
DATATABLE(
"Hierarchy", STRING,
"Order", INTEGER,
{
{"Division", 1},
{"DSO Region", 2},
{"KPI Customer Cluster", 3},
...
}
)

Join it to your Dynamic Hierarchy table and sort accordingly. This helps predefine the path in visuals if needed.


Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!







View solution in original post

Ilgar_Zarbali
Super User
Super User

The native Decomposition Tree in Power BI does not support fully dynamic hierarchies that change based on slicer selections — the levels must be predefined manually or via field parameters. However, you can simulate the dynamic behavior like this:

 

Workaround: Use Field Parameters for Dynamic Hierarchy

 

  1. Create a Field Parameter:
    * Go to Modeling → New Parameter → Fields.
    * Select your hierarchy options:
       Division, DSO Region, KPI Customer Cluster, Country Sold To, etc.
    * Name it like: Dynamic Hierarchy.

  2. Use This Parameter in Decomposition Tree:

    * Drag Dynamic Hierarchy into the “Explain by” section of the visual.

    * Now users can choose hierarchy levels directly in the slicer.

  3. Allow Multiple Selections (Optional):

    * Change slicer settings to allow users to choose more than one field.

    * However, only the top selected field will be used at first level — Power BI won't auto-expand deeper.

Suggestions:

Instead of relying fully on the Decomposition Tree:

  • Consider a custom visual or Matrix + Drill-through buttons to mimic this behavior more dynamically.
  • You may also vote for similar features on ideas.powerbi.com to get it natively supported.


If this workaround helps, please mark as solution and give kudos.

View solution in original post

Hello @Mina_PowerBI ,

 

Hi, thanks for checking in!

I totally get what you're looking for you want the Decomposition Tree to open up automatically when you use slicers or filters, kind of like how bar charts react. Right now, though, Power BI doesn’t let the Decomposition Tree auto-expand.

Even if you set up field parameters or slicers, you still have to click the “+” to drill down each level. That’s just how the visual works at the moment. You can try workarounds like creating separate trees for common drill paths and toggling them with bookmarks, but it’s not fully automated. Some folks have already requested this feature on Power BI Ideas, so it’s worth upvoting if it’s important to you.

For now, manual clicks are still needed to expand the tree.

 

I'm happy to help if you have any other  queries.

 

Thank you.

View solution in original post

9 REPLIES 9
v-tejrama
Community Support
Community Support

Hi @Mina_PowerBI ,

Thanks for reaching out to the Microsoft fabric community forum.

 

I've successfully implemented a dynamic Decomposition Tree in Power BI that fully adapts to slicer selections. Instead of a fixed hierarchy, users can choose which fields to drill into such as Customer, Company Code, or DSO Region by leveraging the Field Parameters feature. I created a new parameter from the Modeling tab, selected the required columns, and used the resulting Dynamic Hierarchy table to build a slicer with multi-select enabled. After adding the Decomposition Tree visual, I set my measure (like Total Receivables) in "Analyze" and used Dynamic Hierarchy Fields for "Explain by." This approach gives users complete flexibility to explore the data as needed, fully addressing the original requirement. The only limitation is that Power BI doesn't auto-expand all levels, which is expected, but otherwise the solution works flawlessly.

 

Please find the attached pbix file for your reference.

 

Best Regards,
Tejaswi.
Community Support

 

 

Hi tejrama, 
Thank you so much for your help! This is helpful but the situation is that it is not auto expanding, and the decomposition tree should be handled by filters based out of columns. Like we contraol bar graphs with filters based on columns. In the same way, I have to move forward with decomposition tree.  And decomposition tree should auto expand. 

Hello @Mina_PowerBI ,

 

Hi, thanks for checking in!

I totally get what you're looking for you want the Decomposition Tree to open up automatically when you use slicers or filters, kind of like how bar charts react. Right now, though, Power BI doesn’t let the Decomposition Tree auto-expand.

Even if you set up field parameters or slicers, you still have to click the “+” to drill down each level. That’s just how the visual works at the moment. You can try workarounds like creating separate trees for common drill paths and toggling them with bookmarks, but it’s not fully automated. Some folks have already requested this feature on Power BI Ideas, so it’s worth upvoting if it’s important to you.

For now, manual clicks are still needed to expand the tree.

 

I'm happy to help if you have any other  queries.

 

Thank you.

Hi @Mina_PowerBI ,

 

I wanted to follow up and see if you had a chance to review the information shared. If you have any further questions or need additional assistance, feel free to reach out.

 

Thank you,

Tejaswi.

Thank you so much  tejrama for so much of your support. I  followed these steps and was able to present dynamic decomposition tree. Thanks a lot!

Ilgar_Zarbali
Super User
Super User

The native Decomposition Tree in Power BI does not support fully dynamic hierarchies that change based on slicer selections — the levels must be predefined manually or via field parameters. However, you can simulate the dynamic behavior like this:

 

Workaround: Use Field Parameters for Dynamic Hierarchy

 

  1. Create a Field Parameter:
    * Go to Modeling → New Parameter → Fields.
    * Select your hierarchy options:
       Division, DSO Region, KPI Customer Cluster, Country Sold To, etc.
    * Name it like: Dynamic Hierarchy.

  2. Use This Parameter in Decomposition Tree:

    * Drag Dynamic Hierarchy into the “Explain by” section of the visual.

    * Now users can choose hierarchy levels directly in the slicer.

  3. Allow Multiple Selections (Optional):

    * Change slicer settings to allow users to choose more than one field.

    * However, only the top selected field will be used at first level — Power BI won't auto-expand deeper.

Suggestions:

Instead of relying fully on the Decomposition Tree:

  • Consider a custom visual or Matrix + Drill-through buttons to mimic this behavior more dynamically.
  • You may also vote for similar features on ideas.powerbi.com to get it natively supported.


If this workaround helps, please mark as solution and give kudos.

Hi ,
Thank you so much for your help! This is helpful but the situation is that it is not auto expanding, and the decomposition tree should be handled by filters based out of columns. Like we contraol bar graphs with filters based on columns. In the same way, I have to move forward with decomposition tree.  And decomposition tree should auto expand.

johnbasha33
Super User
Super User

@Mina_PowerBI 

Key Understanding

  • The Decomposition Tree visual in Power BI expects static hierarchies.

  • But Field Parameters (introduced in 2022) allow dynamic selection of columns as dimensions.

  • What cannot be automated directly is:

    • Changing the hierarchy path automatically based on filter selections.

    • Auto-expansion of branches (Power BI still requires user clicks for drill-down).

We can work around this with Field Parameters + slicers.

Step-by-Step Solution

🔧 1. Create a Field Parameter for Dynamic Hierarchy

Go to Modeling > New Parameter > Fields.

Add all 10 dimensions as choices:

Division
DSO Region
KPI Customer Cluster
Country Sold To
Country Ship To
Customer Sold To
Customer Ship To
Customer Payer
Production Plant
Company Code

Rename the parameter as: Dynamic Hierarchy.

This will create:

  • A parameter table (Dynamic Hierarchy)

  • A DAX column called [Dynamic Hierarchy Fields]

A DAX measure like:

Selected Hierarchy = SELECTEDVALUE('Dynamic Hierarchy'[Dynamic Hierarchy Fields])

Use Dynamic Fields in Decomposition Tree

Add the Dynamic Hierarchy field (from the parameter) into the decomposition tree as your hierarchy level.

Add your measure (like Total Receivables, Count of Customers, etc.) to analyze.

⚠️ Note:

  • You can only select one field at a time in decomposition trees.

For multiple levels, the user has to manually expand the hierarchy within the visual, unless you pre-define the field order via slicer control.

Simulate Ordered Path Using a Slicer

To simulate "first this filter, then next," create a multi-select slicer on your Dynamic Hierarchy parameter table.

This allows users to choose the path they want interactively. While Power BI won’t auto-expand based on the slicer, it will enable:

  • Controlled inclusion of fields

Dynamic structure driven by user choice

Optional: Create Custom Table for Slicer Order

If needed, create a custom table to track the sequence of hierarchy (using a ranking mechanism):

HierarchyOrder =
DATATABLE(
"Hierarchy", STRING,
"Order", INTEGER,
{
{"Division", 1},
{"DSO Region", 2},
{"KPI Customer Cluster", 3},
...
}
)

Join it to your Dynamic Hierarchy table and sort accordingly. This helps predefine the path in visuals if needed.


Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!







Hi ,
Thank you so much for your help! This is helpful but the situation is that it is not auto expanding, and the decomposition tree should be handled by filters based out of columns. Dynamic decomposition tree should be user friendly so that it could auto expanding according to what user wants to create hierarchy. Like we contraol bar graphs with filters based on columns. In the same way, I have to move forward with decomposition tree.  And decomposition tree should auto expand.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 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.

Top Solution Authors