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
Reagorn
Frequent Visitor

Sum of max not summing at hierarchy level

I have a attached a picture of my table below. My rolled up heirchy is category and if you drill down you see the customers within that category. LOS is the length of stay. What I am trying to do is get the MAX LOS when I drill down to the customers. (this is because the customer may show up 20 times and their LOS will be the same for all 20 rows - so I just need their LOS once). For LOS dept test, for the category that I expanded, you can see that 6 customers with 1 day each, now when I collapse this category to hide the customers, I need to see 6, not 1.11. I believe the overal total of "Los test" is right, but I can't confirm since the totals of the categories is wrong. 

 

My code for LOS for dept test is 

= SUMx(summarize(Query1,Query1[QBP], "Max LOS", Max(Query1[LOS_Days])),
[Max LOS])
 
My code for los test is 
sumx(
ADDCOLUMNS(
SUMMARIZE(
Query1,
'Query1'[QBP]
),
"MaxLOS",
Maxx (Query1,
Query1[LOS]
)
),
[MaxLOS]
)


Capture.PNG

How can I make the categories sum the maxes as well?

1 REPLY 1
Anonymous
Not applicable

Hi @Reagorn ,

 

According to your statement, I think your requirement is to show dynamic subtotal when you expand/collapse your hierarchy level in your matrix. As far as I know, this is not supported in Power BI. We could show result with different calculation logic in each hierarchy level by ISINSCOPE().

 

Best Regards,
Rico Zhou

 

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

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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