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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch 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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.