cancel
Showing results for 
Search instead for 
Did you mean: 
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
Microsoft
Microsoft

@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
Microsoft
Microsoft

@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
August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 24 without aka link and time 768x460.jpg

Ted's Dev Camp - July 28, 2022

Watch Session 24 of Ted's Dev Camp along with past sessions!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors