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

Is there any way to show/hide a subtotal in a matrix, controlling by a measure?

Hi! my user wants me to show a matrix with data that have different levels of hierarchy. She wants something like this (note the "Total" that summarize Label 3C1+Label 3C2+Label 3C3) 

Captura.PNG

I can't hide the subtotal for those groups of data wich this level is blank():

Captura2.PNG

Any suggestion? Tnk!

1 ACCEPTED SOLUTION
v-zhenbw-msft
Community Support
Community Support

Hi @NatachaPN ,

 

We can create two measures to meet your requirement.

 

Measure = 
var _total = IF(MAX('Table'[OC])="",0,1)
return
IF(ISFILTERED('Table'[PC]),0,1)+_total

 

Total = 
IF(
    [Measure]=1,
    CALCULATE(SUM('Table'[Quantity]),FILTER('Table','Table'[OC]<>"")),
    SUM('Table'[Quantity]))

 

is1.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

 

Best regards,

 

Community Support Team _ zhenbw

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

 

BTW, pbix as attached.

View solution in original post

2 REPLIES 2
v-zhenbw-msft
Community Support
Community Support

Hi @NatachaPN ,

 

We can create two measures to meet your requirement.

 

Measure = 
var _total = IF(MAX('Table'[OC])="",0,1)
return
IF(ISFILTERED('Table'[PC]),0,1)+_total

 

Total = 
IF(
    [Measure]=1,
    CALCULATE(SUM('Table'[Quantity]),FILTER('Table','Table'[OC]<>"")),
    SUM('Table'[Quantity]))

 

is1.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

 

Best regards,

 

Community Support Team _ zhenbw

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

 

BTW, pbix as attached.

lbendlin
Super User
Super User

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
Users online (5,244)