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
sonuojha1
Helper IV
Helper IV

How to add an additional column sub total in matrix ?

Hello All,

 

I have a requirement to display subtotal of 3 countries outof 8 as an additional column only.

 

How can I achieve the Subtotal of only 3 countries ie (Sweden,Finland,Norway). 

here "Total scandin" is the expected column which hold the sum of Sweden+Finland+Norway.
Also I need Grand total as well.

The output should be in the same format as given below.

 

Expected output (Matrix)

Expected result column "Total Scandin"Expected result column "Total Scandin"

1 ACCEPTED SOLUTION
v-zhenbw-msft
Community Support
Community Support

Hi @sonuojha1 ,

 

We can create two matrix table visuals and use selection function to meet your requirement.

 

1. We need to create a measure that calculates the total of three countries.

 

Total scandin = 
CALCULATE(
    SUM('Table'[value]),
    FILTER (ALLSELECTED('Table'[country]),'Table'[country] in {"A","B","C"}))

 

2. Then we create a matrix table that just contains date and measure.

 

H1.jpg

 

3. Then we create a new matrix table and cover it on the original matrix table.

 

H2.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

 

Best regards,

 

Community Support Team _ zhenbw

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

 

BTW, pbix as attached.

View solution in original post

2 REPLIES 2
v-zhenbw-msft
Community Support
Community Support

Hi @sonuojha1 ,

 

We can create two matrix table visuals and use selection function to meet your requirement.

 

1. We need to create a measure that calculates the total of three countries.

 

Total scandin = 
CALCULATE(
    SUM('Table'[value]),
    FILTER (ALLSELECTED('Table'[country]),'Table'[country] in {"A","B","C"}))

 

2. Then we create a matrix table that just contains date and measure.

 

H1.jpg

 

3. Then we create a new matrix table and cover it on the original matrix table.

 

H2.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that you have shared?

 

Best regards,

 

Community Support Team _ zhenbw

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

 

BTW, pbix as attached.

harshnathani
Community Champion
Community Champion

Hi @sonuojha1 ,

 

See if this helps.

 

Measure = CALCULATE(SUMX(Sales,[Sales]),
FILTER (ALL(Geography[Country]),Geography[State] in {"Sweden","Finland","Norway"}))

 

Regards,
Harsh Nathani

Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

 

 

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.