Forum Discussion

yewling1201's avatar
yewling1201
Frequent Visitor
4 years ago
Solved

Sum the Amount and Get the Name

Hi everyone,   Using DAX, how do I get the Salesperson name who has the least Sales Amount?  Amount Name 3.984 Edward 3.1825 Denise 12.7415 John 3.992 Philips 12.7415 Edwar...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi yewling1201 ,

     

    • Method1: Without DAX, just apply TopN filter to the Card visual:

     

    • Method2: Using RANKX()
    Rank = RANKX(ALL('Table'),CALCULATE(SUM('Table'[Amount]),ALLEXCEPT('Table','Table'[Name])),,ASC,Dense)​
    who has the least Sales Amount = CALCULATE(MAX('Table'[Name]),FILTER('Table',[Rank]=1))

    Output:

    Best Regards,
    Eyelyn Qin
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.