Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
mavdom18
Regular Visitor

Matrix total calculation

Hi everyone,

I've been struggling to find a way to calculate the total of a matrix.

I'm trying to divide the sum total of the column by 15. 

Is there a way to do that? 

Like in excel, we can just sum up the table and divide it by any numbers, but I can't do it in power bi 

 

IMG_20230607_090413.jpg

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

Hi @mavdom18 ,

In Power BI, the Total row can't be customized. If you want to get the expected result, you need to create a new table contains value "Enterprise" and define its value. Here's my solution:

1.Create a new table. Sort LOB by Index column.

vyanjiangmsft_0-1686300855174.png

Create relationship between the two tables with LOB column.

vyanjiangmsft_1-1686300923482.png

2.Create three measures.

HC =
IF (
    SUM ( 'Table'[HC] ) <> BLANK (),
    SUM ( 'Table'[HC] ),
    SUMX ( ALL ( 'Table' ), 'Table'[HC] ) / 15
)
Email% =
IF (
    MAX ( 'Table'[Email%] ) <> BLANK (),
    MAX ( 'Table'[Email%] ),
    AVERAGEX ( ALL ( 'Table' ), 'Table'[Email%] )
)
Voice% =
IF (
    MAX ( 'Table'[Voice%] ) <> BLANK (),
    MAX ( 'Table'[Voice%] ),
    AVERAGEX ( ALL ( 'Table' ), 'Table'[Voice%] )
)

Get the result:

vyanjiangmsft_2-1686301109133.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

3 REPLIES 3
v-yanjiang-msft
Community Support
Community Support

Hi @mavdom18 ,

In Power BI, the Total row can't be customized. If you want to get the expected result, you need to create a new table contains value "Enterprise" and define its value. Here's my solution:

1.Create a new table. Sort LOB by Index column.

vyanjiangmsft_0-1686300855174.png

Create relationship between the two tables with LOB column.

vyanjiangmsft_1-1686300923482.png

2.Create three measures.

HC =
IF (
    SUM ( 'Table'[HC] ) <> BLANK (),
    SUM ( 'Table'[HC] ),
    SUMX ( ALL ( 'Table' ), 'Table'[HC] ) / 15
)
Email% =
IF (
    MAX ( 'Table'[Email%] ) <> BLANK (),
    MAX ( 'Table'[Email%] ),
    AVERAGEX ( ALL ( 'Table' ), 'Table'[Email%] )
)
Voice% =
IF (
    MAX ( 'Table'[Voice%] ) <> BLANK (),
    MAX ( 'Table'[Voice%] ),
    AVERAGEX ( ALL ( 'Table' ), 'Table'[Voice%] )
)

Get the result:

vyanjiangmsft_2-1686301109133.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

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

amitchandak
Super User
Super User

@mavdom18 , Not very clear

 

example is

divide( calculate(sum(Table[HC]), allselected() ), 15)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Apologies, I just realized that the image is confusing. To give more context, enterprise is my grand total. Instead of it being just the sum of all the lob combined, I want it to be divided by 15. However, the problem is that it's not as easy as doing it in excel where I can just edit the total formula to be divided by 15.

 

  • What I wanted to do is to make a calculation in my matrix total so that it sums up all the lob and then divide it by 15.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.