cancel
Showing results for
Did you mean:
Helper I

## Subtotals - different rules for different columns

Hi All,

I have a matrix table, with measures as values. Measures are calculated based on Places, but when I create the matrix table I want to show Councils as well.

Is there any possibility to show subtotals in some columns, and leave it empty in others?

Once I use this:

I can see all subtotals, not sure if there is a tool to split it or maybe I can add some information to the measure?

G.

1 ACCEPTED SOLUTION
Community Support

Hi, @A_a_a

You can try the following methods.

Sample data:

Measure:

``A = SUM('Table'[Value])``
``B = DIVIDE(SUM('Table'[Value]),CALCULATE(SUM('Table'[Value]),ALL('Table')))``
``Measure A = IF(HASONEVALUE('Table'[Type]),[A],BLANK())``
``Measure B = IF(HASONEVALUE('Table'[Type]),[B],BLANK())``

Row total is always on. But Dax can control whether Total outputs blank or numeric.

Best Regards,

Community Support Team _Charlotte

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

5 REPLIES 5
Community Support

Hi, @A_a_a

You can try the following methods.

Sample data:

Measure:

``A = SUM('Table'[Value])``
``B = DIVIDE(SUM('Table'[Value]),CALCULATE(SUM('Table'[Value]),ALL('Table')))``
``Measure A = IF(HASONEVALUE('Table'[Type]),[A],BLANK())``
``Measure B = IF(HASONEVALUE('Table'[Type]),[B],BLANK())``

Row total is always on. But Dax can control whether Total outputs blank or numeric.

Best Regards,

Community Support Team _Charlotte

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

Helper I

Hi @v-zhangti ,

this is perfect. Thank you!

Super User

Hi,

The measure of those 2 columns can be modified.  Share the download link of the PBI file.

Regards,
Ashish Mathur
http://www.ashishmathur.com
Helper I

Hi @amitchandak,

If I use the function that you mentioned above I will see subtotals (on/off) for all columns.

My question is if I can have it on only for two columns as I showed in the picture above ( 2 - on, 2 off).

Thanks,

G.

Super User

@A_a_a , In subtotal you have an option for per row level, You can enable and disable subtotal once you use that

Announcements

#### Power BI T-Shirt Design Challenge 2023

Vote for your favorite t-shirt design now through March 28.

#### Power BI March 2023 Update

Find out more about the March 2023 update.

#### March 2023 Events

Find out more about the online and in person events happening in March!

Top Solution Authors
Top Kudoed Authors