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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to return the value in one column based on the highest value in another?

Probably a really easy question but I can't seem to figure it out.

 

My data source looks like this.

 

TABLE1

IDSITECUSTOMERITEMSPEND
11Aitem110
...............

 

I've made a visual in my report that looks like this:

 

CUSTOMERSUM OF SPEND
A40
B20
C100
D50
E220

 

I am trying to write a measure that returns the maximum spend based overall customers. So I want my output to be this.

 

CUSTOMERSUM OF SPENDMAX SPEND
A40220
B20220
C100220

D

50220

E

220220

 

I tried to do CALCULATE(MAX('TABLE1'[SPEND]), ALLSELECTED('TABLE1')) but this returns the highest spend line from TABLE1 not the highest sum of spend line from the visual like I want.

 

Anyone able to help me please?

 

Thank you.

1 ACCEPTED SOLUTION
tex628
Community Champion
Community Champion

Hi @Anonymous ,

Try this:

Measure = MAXX( SUMMARIZE( ALLSELECTED(Table1) , Table1[Customer] , "Value" , SUM(Table[Spend]) ) [Value] )

Connect on LinkedIn

View solution in original post

2 REPLIES 2
tex628
Community Champion
Community Champion

Hi @Anonymous ,

Try this:

Measure = MAXX( SUMMARIZE( ALLSELECTED(Table1) , Table1[Customer] , "Value" , SUM(Table[Spend]) ) [Value] )

Connect on LinkedIn
Anonymous
Not applicable

Worked perfectly thank you. I forgot the SUMMARIZE function.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.