Forum Discussion
yewling1201
4 years agoFrequent Visitor
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 | Edward |
| 12.7415 | Elvin |
| 4.731 | Denise |
Eg: sum the sale amount 1st for every salesperson, I want to have the Salesperson with least salesamount, ie Phillips.
| Amount | Name |
| 16.7255 | Edward |
| 7.9135 | Denise |
| 12.7415 | John |
| 3.992 | Philips |
| 12.7415 | Elvin |
Thank you in advance!
- Anonymous4 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.
3 Replies
- AnonymousNot applicable
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. - JMD22SiFrequent Visitor
Couldn't you just put the two values in a table, sum the Amount and sort decending?
- yewling1201Frequent Visitor
Hi,
I only need to have the name of the Salesperson. and display in the Card Visual.
Thank you!