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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Is it possible to create de-duplicated hierarchies for drill downs in Power BI?

Hi there,

Here is my dilemma: I have a table of product sales data that looks like this:

63lZ6.png

 

 

 

 

I want to be able to aggregate this data by 'Category'. However, as it is possible that the Apple, Orange and Pear were all purchased within the same order number, the aggregated data (de-duplicated) could look something like this:

0AywQ.png

 

 

 

I have imported the raw data tables to show both levels of aggregation shown above.  How can I create a hierarchy using the data from a combination of these two tables in order to create a dynamic 'Number of Orders' (which is dependent on the level in the hierarchy being displayed)?

I've searched a number of forums and experimented for a few hours on own but cannot find a solution.

Thanks for your help!

1 ACCEPTED SOLUTION
dax
Community Support
Community Support

Hi @Anonymous , 

Did you mean that you want to get below result?

581.PNG582.PNG

 If so, you could try below measure to see whether it work or not

Measure 3 = if(HASONEVALUE('Table'[category]),MIN('Table'[amount]),SUMX(SUMMARIZE('Table','Table'[category], "a", MIN('Table'[amount])),[a]))

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
dax
Community Support
Community Support

Hi @Anonymous , 

Did you mean that you want to get below result?

581.PNG582.PNG

 If so, you could try below measure to see whether it work or not

Measure 3 = if(HASONEVALUE('Table'[category]),MIN('Table'[amount]),SUMX(SUMMARIZE('Table','Table'[category], "a", MIN('Table'[amount])),[a]))

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @dax,

Yes, this is EXACTLY what I've been looking for.  Thank you so much. 

Please can you talk me through how this calculated measure is working (I'm quite new to Power BI)? 😀

dax
Community Support
Community Support

Hi @Anonymous , 

Because for the expression and context the grand total is not work, so we need to redefine the expression for grand total. we need use summarize function to redefine the table and simplify the table stracture which group by category and have a column to show the min value for each category, then you could sum the min column as grand total.  And you also could refer to /hasonevalue-vs-isfiltered-vs-hasonefilter/  for details.

Best Regards,
Zoe Zhi

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors