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
PowerUser123
Helper II
Helper II

Matrix - Show Max as Values but Sum as Total

I have a matrix that looks like this based on my below measure:

 

PowerUser123_0-1619812057290.png

 

Test = if(HASONEVALUE('Product'[ProductName]),MAX('Product'[ProductPrice]),SUM('Product'[Product Price]))

 

My measure works correctly for the row totals going across. It shows the sum. However, I would also like to show the sum of the columns going down but it currently just shows the max value. Is there a way I can alter the above to show sums as the total and max as values?

 

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

Hi @PowerUser123 ,

 

Use the following measure, it will work as you expected:

 

measurename =
SUMX (
    SUMMARIZE (
        'Product',
        'Product'[ProductName],
        "_MAXPRICE", MAX ( 'Product'[Product Price] )
    ),
    [_MAXPRICE]
)

 

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

 

Best Regards,

Dedmon Dai

View solution in original post

3 REPLIES 3
v-deddai1-msft
Community Support
Community Support

Hi @PowerUser123 ,

 

Use the following measure, it will work as you expected:

 

measurename =
SUMX (
    SUMMARIZE (
        'Product',
        'Product'[ProductName],
        "_MAXPRICE", MAX ( 'Product'[Product Price] )
    ),
    [_MAXPRICE]
)

 

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

 

Best Regards,

Dedmon Dai

Jihwan_Kim
Super User
Super User

Hi, @PowerUser123 

 

 

I assume x y z are category.

 

Please try the below.

 

Test fix =
IF (
HASONEVALUE('Product'[ProductName]) && HASONEVALUE('Product'[Category]),
MAX ( 'Product'[ProductPrice] ),
SUM ( 'Product'[ProductPrice] )
)
 
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

TomMartens
Super User
Super User

Hey @PowerUser123 ,

use this DAX to create your measure:

measurename = 
SUMX(
    VALUES('Product'[ProductName])
    ,CALCULATE(MAX(Product'[Product Price]))
)

Hopefully, this provides what you are looking for.

 

Regards,
Tom



Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany

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.