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

Try your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now

Reply
pelowski
Helper III
Helper III

DAX Formula - Return a calculated column MAX after grouping multiple other columns

I know this should be easy but despite trying and trying different options and searching for a couple hours, I can't get this to work.

 

As an example, I have scores in a table like this...

 

PlayerDateCourtGameScore
Andy12/20/20171115
Bert12/20/20171110
Jeff12/20/20171110
Ryan12/20/20171115
Hank12/20/2017214
Pete12/20/20172118
Mike12/20/20172118
Kevin12/20/2017214

 

I'd like to return a new calculated column value of the MAX score for a combination of 3 grouped values, the date, the court, and the game. So essentially 15 for the first 4 rows and 18 for the second 4 rows and so on.

 

The closest attempts I've found are

=CALCULATE(MAX('Scores'[Score]), GROUPBY(Scores,[Date],[Court],[Game]))

but that seems to simply return the Score value for the current row.

 

=MAXX(SUMMARIZE(Scores,[Date],[Court],[Game],"Max Score of Specific Game",MAX([Score])),[Max Score of Specific Game])

seems to always return the max regardless of how many different games are showing.

 

I've looked and looked for solutions to this and I just can't figure out what I'm doing wrong. I'm new to DAX and while this would be easy for me as a SQL query, I'm struggling with the DAX representation of it. I'm sure it's likely a simple solution and any help you can provide will be appreciated.

 

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

Hi @pelowski

 

Try this Column

 

MyMax =
CALCULATE (
    MAX ( Scores[Score] ),
    ALLEXCEPT ( Scores, Scores[Date], Scores[Court], Scores[Game] )
)

View solution in original post

4 REPLIES 4
Zubair_Muhammad
Community Champion
Community Champion

Hi @pelowski

 

Try this Column

 

MyMax =
CALCULATE (
    MAX ( Scores[Score] ),
    ALLEXCEPT ( Scores, Scores[Date], Scores[Court], Scores[Game] )
)

I'm also looking to do the same and this solution almost gets me there.  Is it possible to only show the max value in the row that has the value and leave the remaining blank?  For Example in the section in the blue box, Is it possible to show the highest score of 18 only in the row that has the score of 18 and leave the other rows blank?

Yes!  That did it!  Thank you!

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.