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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Syndicate_Admin
Administrator
Administrator

Sum of Maximum Values

Hello Community good evening,

The problem I'm having is that in the column "Max lumps. by tte" in the final value painted in bold does not make me the sum of the lines below marks me only 45 but does not add 14+36+14+38

The column "Max packages. by tte" comes from the following DAX formula

Max Packages. by TTE =
MAXX(
KEEPFILTERS(VALUES('Combine1'[sap.transport])),
CALCULATE(SUM('Combine1'[row_num]))
)

Ruteo_0-1737509034546.png

5 REPLIES 5
v-yiruan-msft
Community Support
Community Support

Hi @Ruteo ,

You can create another measure as below and replace the original measure [Max Packages. by TTE] onto the matrix visual.

Measure = SUMX ( VALUES ( 'Combine1'[Sucursal] ), [Max Packages. by TTE] )

If the above one can't help you figure out, please provide some sample data in the table 'Combine1' (exclude sensitive data) with Text format and your expected result with backend logic base on the provided sample data. It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

 

And it is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

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

Hello, hello to him,

I will show what would be the result that they are requesting from me.

In the left column is a locality which below has the enumeration of several routes

In the first grand total (route 1 - 17) 17 is the number of equipment loaded on that route

In the second grand total is a formula that calculates the MAX of teams that I carry =MAX(B9:JF9) B9 AND JF9 is the range of the rows of that route to calculate the maximum

And so consecutively with all the other routes is to calculate the max of equipment that I carry and in the end add up all those maximums to get a final number in this case the sum of the maximums is 2435.

Ruteo_3-1737713844488.png

Under this formula, DAX managed to obtain the maximum number of equipment carried by each transport.

I have the column Lumps max. by tte and the column Equipment x route

The problem is that the column Max Packages per tte is not adding up all those maximum values and indicates a value that is 97.

When what I need is for him to add those maximum values (25 + 39 + 52 + 14 + 34 + 38) and instead of 97 give me the value of that sum.

Max Packages. by TTE =
MAXX(
KEEPFILTERS(VALUES('Combine1'[sap.transport])),
CALCULATE(SUM('Combine1'[row_num]))
)

Ruteo_4-1737714527520.png

Best regards

Hi @Ruteo ,

Could you please provide some sample data in the table 'Combine1(exclude sensitive data) with Text format, the fields settings of visual in the below screenshot and your expected result with backend logic base on the provided sample data? It would be helpful to find out the solution. You can refer the following link to share the required info:

How to provide sample data in the Power BI Forum

vyiruanmsft_0-1737968032778.png

 

And it is better if you can share a simplified pbix file. You can refer the following link to upload the file to the community. Thank you.

How to upload PBI in Community

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
danextian
Super User
Super User

Hi @Syndicate_Admin 

Since you're using MAXX, it will return the maximum row_num value in 'Combine1'[sap.transport]. To evaluate this MAXX for each row individually before being summed up in the total row, you can use SUMX.

SUMX (
    -- Iterate over each unique value of 'table'[column]
    VALUES ( 'table'[column] ), 
    
    MAXX (
        -- For each value of 'table'[column], iterate over unique values of 'Combine1'[sap.transport]
        VALUES ( 'Combine1'[sap.transport] ), 
        
        -- Calculate the sum of 'Combine1'[row_num] for each value of 'Combine1'[sap.transport]
        SUM ( 'Combine1'[row_num] )
    )
)

 










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
Ritaf1983
Super User
Super User

Hi @Syndicate_Admin 

Please share sample data (excluding sensitive information) in text format, along with your expected result and any relevant logic. For guidance, refer to

How to provide sample data in the Power BI Forum

If possible, upload a simplified .pbix file using this guide:

 How to upload PBI in Community

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

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! Prices go up Feb. 11th.

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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