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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Measure to get Value with the highest (SUM)

Hi, hopefully someone can help me

 

I have a table in my Tabular Model that looks like the below

 

DateDescriptionCalls
01/01/2020IT345
01/02/2020Legal23
01/02/2020Helpline2345

What I want to build is a measure that just brings me the Description with the highest Calls in the period. So for the above, the Measure would show "Helpline" as it has 2345 calls.

I have created the below but it doesn't work for me and gives me the wrong description - can anyone help?

ParallelName:=CALCULATE(LASTNONBLANK('Productivity'[Description],0),FILTER(VALUES('Productivity'[Description]),rankx(all('Productivity '[Description]),[Calls],,ASC) = 1 ))

1 ACCEPTED SOLUTION
P_D_G
Resolver III
Resolver III

Hi @Anonymous ,

 

this should answer your question:

https://community.powerbi.com/t5/Desktop/DAX-Retrieve-a-value-in-one-column-based-on-MAX-in-another/td-p/606141

 

Please give kudos to the original responder in the linked post.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Why asc sort when you need highest?

 

try

 

DRank = RANKX(all(Table[Description]),[Calls])

Rank 1 top = maxx(filter(VALUES(Table[Description]),[DRank]=1),Table[Description] )

 

or

Top 1 Rank = CALCULATE(max(Table[Description]),TOPN(10,all(Table[Description]),[Calls],DESC),VALUES(Table[Description]))

P_D_G
Resolver III
Resolver III

Hi @Anonymous ,

 

this should answer your question:

https://community.powerbi.com/t5/Desktop/DAX-Retrieve-a-value-in-one-column-based-on-MAX-in-another/td-p/606141

 

Please give kudos to the original responder in the linked post.

Anonymous
Not applicable

Hi, this works perfect for me thank you.

 

What would be the best way of using this to get the 2nd highest SUM?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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