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

Is there a way to achieve this?

Thanks!

1 ACCEPTED SOLUTION
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.

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.
11 REPLIES 11
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.

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

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!

Helper III

Thank you both for your help!

Community Champion

@udian

Pleasse Give it a shot

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

Regards
Zubair

Community Champion

@udian

```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

Helper III

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!

Community Champion

@udian

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

Regards
Zubair

Helper III

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) .

Community Champion

@udian

Could you share your file with me?

Regards
Zubair

Helper III

Is there a way to share it in this thread?

Community Champion

@udian

Regards
Zubair

Announcements

#### The Power BI Community Show

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

#### Ted's Dev Camp - July 28, 2022

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