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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
udian
Helper III
Helper III

Removing Row Sub Totals from Matrix and Leaving the Row Grand Total

Hi,

 

i have a matrix with 3 row fields, 1 column field and 2 measures.

 

i want to have a grand total row but it seems that i can't have a grand total row without having all the sub total rows in between.

Capture.JPG

 

Is there a way to achieve this?

 

Thanks!

 

1 ACCEPTED SOLUTION
v-yuezhe-msft
Employee
Employee

@udian,

In the Matrix visual, go to Format->Subtotals, turn on per row level, then turn on total for "Active Category" , and turn off total for "Active Sub Category". There is an example for your reference.

1.PNG


Regards,
Lydia

Community Support Team _ Lydia Zhang
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

11 REPLIES 11
v-yuezhe-msft
Employee
Employee

@udian,

In the Matrix visual, go to Format->Subtotals, turn on per row level, then turn on total for "Active Category" , and turn off total for "Active Sub Category". There is an example for your reference.

1.PNG


Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

What version of Power BI Desktop are you using that shows this option? In the Format pane, even though I have the Total Rown marked as 'On', I don't see a Subtotal section as you have in your screenshot. Any ideas why? Thanks a lot for the help!

 

Subtotal BI- 1.png         Subtotal BI- 2.png

 

 

 

 

Thank you both for your help!

Zubair_Muhammad
Community Champion
Community Champion

@udian

 

Pleasse Give it a shot

 

New Measure =
IF (
    HASONEFILTER ( Table1[Activity Sub Category] )
        && NOT ( HASONEFILTER ( Table1[Activity Category] ) ),
    [Measure2]
)

Regards
Zubair

Please try my custom visuals

@udian

 

Please try this one instead of one above

 

New Measure =
SWITCH (
    TRUE (),
    HASONEFILTER ( Table1[Activity Sub Category] )
        && HASONEFILTER ( Table1[Activity Category] ), [Measure2],
    NOT ( HASONEFILTER ( Table1[Activity Sub Category] ) )
        && NOT ( HASONEFILTER ( Table1[Activity Category] ) ), [Measure2]
)

Regards
Zubair

Please try my custom visuals

Hi Muhammad,

 

I get the following error message:

The value for Measure 2 Cannot be determined. Either Measure 2 doesn't exist, or there is no current row for a column named Measure 2.

 

Thanks!

@udian

 

is measure2 a COLUMN in your data or a MEASURE that you have created?

 


Regards
Zubair

Please try my custom visuals

I see what you were saying. I was using the original column with the default aggregation that PBI applied on the column. 

I created 2 measures based on the original columns and now i don' t get the error message.

 

In my original post you cant see the third column so i tried modifiying your measures accordingly.

These are the measures :

New Measure11 = 
SWITCH (
    TRUE (),
    HASONEFILTER ( Sheet1[Activity Sub Category] )
        && HASONEFILTER ( Sheet1[Activity Category] )
        && HASONEFILTER ( Sheet1[Is In Network] ), [Column1],
    NOT ( HASONEFILTER ( Sheet1[Activity Sub Category] ) )
        && NOT ( HASONEFILTER ( Sheet1[Activity Category] ) )
        && NOT ( HASONEFILTER ( Sheet1[Is In Network] ) ), [Column1]
)

New Measure22 = 
SWITCH (
    TRUE (),
    HASONEFILTER ( Sheet1[Activity Sub Category] )
        && HASONEFILTER ( Sheet1[Activity Category] )
        && HASONEFILTER ( Sheet1[Is In Network] ), [Column2],
    NOT ( HASONEFILTER ( Sheet1[Activity Sub Category] ) )
        && NOT ( HASONEFILTER ( Sheet1[Activity Category] ) )
        && NOT ( HASONEFILTER ( Sheet1[Is In Network] ) ), [Column2]
)

 This is the matrix with the old measures and the new measures. As you can see some of the sub total numbers disappeared but the Total header is still there. Also, the grand total numbers were removed as well and the 3rd level sub totals still remain (i guess this is due to the change i made to your measure) .

 

Capture.JPG

@udian

 

Could you share your file with me?


Regards
Zubair

Please try my custom visuals

Is there a way to share it in this thread?

@udian

 

You can upload the file to Onedrive or GoogleDrive and share the link here


Regards
Zubair

Please try my custom visuals

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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