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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
JMcAnarney1
Helper I
Helper I

Question on finding Max for Sum per category?

Hello, i have following data; how can I write a formula to show the max bid per event based on total cost that is not the engineering estimate.  I do know to get the formula for the sum is the following but do not know how to get max : 

Highest Non Engineering Estimate = Calculate(SUM('Bid Template Data'[Total Cost]),'Bid Template Data'[Bidder] <> "Engineering Estimate")
 
How can I add a max function for this???

JMcAnarney1_0-1682347298789.png

 

2 ACCEPTED SOLUTIONS

Max Non Engineering Estimate =
MAXX (
    SUMMARIZE (
        'Table',
        'Table'[Bid event id],
        'Table'[Bidder],
        'Table'[Description]
    ),
    [Highest Non Engineering Estimate]
)

You need to put in the SUMMARIZE enough columns to uniquely identify a row. If there is a unique ID in your dataset then you could just use that column.

View solution in original post

Its possible that the the SUMMARIZE still isn't at the correct granularity. You can check what is being returned by creating a new table using

Tmp table =
ADDCOLUMNS (
    SUMMARIZE (
        'Bid Template Data',
        'Bid Template Data'[Bid Event],
        'Bid Template Data'[Bidder],
        'Bid Template Data'[Description.1]
    ),
    "Highest estimate", [Highest Non Engineering Estimate]
)

and see what that shows in the data view. You may need to add more columns into the SUMMARIZE

View solution in original post

7 REPLIES 7
tamerj1
Super User
Super User

Hi @JMcAnarney1 

please try

Maximum None Engineering Bid =
SUMX (
SUMMARIZE (
FILTER ( 'Table', 'Table'[Bidder] <> "Engineering Estimate" ),
'Table'[Bid event id],
'Table'[Description],
"MaxBid", MAX ( 'Bid Template Data'[Total Cost] )
),
[MaxBid]
)

johnt75
Super User
Super User

You can use

Max Non Engineering Estimate =
MAXX ( VALUES ( 'Table'[Bid event id] ), [Highest Non Engineering Estimate] )

Issue is that does not divide out the multiple non - engeering estimate bidders and it sums them together.  For example, there were two other bidders and it is lumping them together based off your formula when in reality just want one that is highest

Max Non Engineering Estimate =
MAXX (
    SUMMARIZE (
        'Table',
        'Table'[Bid event id],
        'Table'[Bidder],
        'Table'[Description]
    ),
    [Highest Non Engineering Estimate]
)

You need to put in the SUMMARIZE enough columns to uniquely identify a row. If there is a unique ID in your dataset then you could just use that column.

So here is what I have feeding into eachother:

 

Highest Non Engineering Estimate = Calculate(SUM('Bid Template Data'[Total Cost]),'Bid Template Data'[Bidder] <> "Engineering Estimate")
 
This is summing together possible bids that that do not represent an estimate which needs to be split out
 
the summarzing function is doing this but in formula above it is not showing highest still:
 
Highest Bid =
MAXX (
    SUMMARIZE (
        'Bid Template Data',
        'Bid Template Data'[Bid Event],
        'Bid Template Data'[Bidder],
        'Bid Template Data'[Description.1]
    ),[Highest Non Engineering Estimate])
 
Which gets me the results: left is output right is what the output should be if highest which is 31,853
JMcAnarney1_0-1682353882040.png

 

 

I think probelm is that my Highest non-engineering formula still needs to breakout it further 

 
 

 

 

I should add I know how to get the highest bidder by name but not by amount with the following formula:

 

TOPN = MAXX( TOPN (1, DISTINCT('Bid Template Data'[Bidder]), Calculate (Sum( 'Bid Template Data'[Total Cost]),'Bid Template Data'[Bidder] <> "Engineering Estimate")),'Bid Template Data'[Bidder])

Its possible that the the SUMMARIZE still isn't at the correct granularity. You can check what is being returned by creating a new table using

Tmp table =
ADDCOLUMNS (
    SUMMARIZE (
        'Bid Template Data',
        'Bid Template Data'[Bid Event],
        'Bid Template Data'[Bidder],
        'Bid Template Data'[Description.1]
    ),
    "Highest estimate", [Highest Non Engineering Estimate]
)

and see what that shows in the data view. You may need to add more columns into the SUMMARIZE

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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