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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
loafers
Frequent Visitor

Return first instance of Max Total

 

Hi,

 

I have the table below and would like the have a column to return the first occurrence of the highest sum. 

IDDatesum
A12/1/2021500
A1/1/2022100
A2/1/20225
B1/1/2022120
B2/1/2022100
C1/1/201920
C6/1/202020
C12/1/202120

 

This table is what I would want. Notice that for ID 'C', even though the sum is the same for the three dates, I just want to show the first time that occurred :

IDDatesumFirst Date of Max sum
A12/1/202150012/1/2021
A1/1/202210012/1/2021
A2/1/2022512/1/2021
B1/1/20221201/1/2022
B2/1/20221001/1/2022
C1/1/2019201/1/2019
C6/1/2020201/1/2019
C12/1/2021201/1/2019

 

I tried the following but it just returns 12/1/21 (highest value in table). 

=CALCULATE(MIN([Date]),FILTER('new table',[sum]=MAX([sum]) && [ID]=[ID]))

 

Is there another way to add in that the ID column should be whatever ID is in that row?

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

Try:

1) Sum value = SUM(Table[sum])

2) First Date of Max Sum = 

VAR _MX = MAXX(ALLEXCEPT (Table, Table [ID]), [Sum value])
RETURN

CALCULATE(MIN(Table[Date]), FILTER(ALLEXCEPT (Table, Table [ID]),  [Sum Value] = _MX))





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @loafers,

Did the above suggestion help with your scenario? if that is the case, you can consider Kudo or accept it to help others who faced similar requirements.

If these also don't help, please share more detailed information to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

PaulDBrown
Community Champion
Community Champion

Try:

1) Sum value = SUM(Table[sum])

2) First Date of Max Sum = 

VAR _MX = MAXX(ALLEXCEPT (Table, Table [ID]), [Sum value])
RETURN

CALCULATE(MIN(Table[Date]), FILTER(ALLEXCEPT (Table, Table [ID]),  [Sum Value] = _MX))





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






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.