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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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
v-rzhou-msft
Community Support
Community Support

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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