cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
A_a_a
Helper I
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?

 

A_a_a_0-1666947505603.png

Once I use this:

A_a_a_1-1666947772775.png

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?

A_a_a_2-1666949917981.png

Please help.

 

G.

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @A_a_a 

 

You can try the following methods.

Sample data:

vzhangti_0-1667265061397.png

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

vzhangti_1-1667265148361.png

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.

 

View solution in original post

5 REPLIES 5
v-zhangti
Community Support
Community Support

Hi, @A_a_a 

 

You can try the following methods.

Sample data:

vzhangti_0-1667265061397.png

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

vzhangti_1-1667265148361.png

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.

 

Hi @v-zhangti ,

 

this is perfect. Thank you!

Ashish_Mathur
Super User
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
https://www.linkedin.com/in/excelenthusiasts/
A_a_a
Helper I
Helper I

Hi @amitchandak,

 

thank you for your reply.

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.

amitchandak
Super User
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

Helpful resources

Announcements
Vote for T-Shirt Design

Power BI T-Shirt Design Challenge 2023

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

March 2023 Update3

Power BI March 2023 Update

Find out more about the March 2023 update.

March Events 2023A

March 2023 Events

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