cancel
Showing results 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.

Frequent Visitor

## Matrix row sum as average but Values as sum

Hi All,

I try to create a matrix where the row total is in Average but the single values should aggregate as sum. but i can only change all aggregation to average or the row total is als as sum.

the matrix should look something like in the following picture. One column with row average and the values with sum aggregation

does anyone can help me with that or can give me another solution.
Thanks!

1 ACCEPTED SOLUTION
Super User

Hi @Jango ,

Not sure if what you need is to have the total in rows or in columns has averages but you should do something similar to:

``````Matrix Values =
IF (
SUM ( Table[Values] ),
AVERAGEX (
CALCULATE ( SUM ( Table[Values] ) )
)
)``````

This will give for each column the sum of the values for the total column it will give you the average of the sums.

This needs to be adjusted to your model but here is an example:

Regards

Miguel Félix

Proud to be a Super User!

Check out my blog: Power BI em Português

2 REPLIES 2
Super User

Hi @Jango ,

Not sure if what you need is to have the total in rows or in columns has averages but you should do something similar to:

``````Matrix Values =
IF (
SUM ( Table[Values] ),
AVERAGEX (
CALCULATE ( SUM ( Table[Values] ) )
)
)``````

This will give for each column the sum of the values for the total column it will give you the average of the sums.

This needs to be adjusted to your model but here is an example:

Regards

Miguel Félix

Proud to be a Super User!

Check out my blog: Power BI em Português

Frequent Visitor

exactly what i needed! Thank you!

Announcements

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

#### Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

#### Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors