Forum Discussion

yewling1201's avatar
yewling1201
Frequent Visitor
4 years ago
Solved

Retrieve Text based on max value

  Hi,   How do I retrieve the Item name based on the highest # of Customers? Eg: highest # of customers is 78, how do i rerieve Rice?   Thank you!  
  • Samarth_18's avatar
    4 years ago

    Hi yewling1201 ,

     

    Please try below measure :-

    Measure = 
    var _max_cust = CALCULATE(MAX('Table'[# of customers]),ALL('Table'[# of customers]))
    return CALCULATE(MAX('Table'[Item]),FILTER('Table','Table'[# of customers] = _max_cust))

     

    BR,

    Samarth

     

  • yewling1201's avatar
    4 years ago

    I really apprecipate your swift response, Samarth. Thank you so much!