Forum Discussion
RANKX- Rank By User
- 9 years ago
How about this?
Owner Opportunity Rank = RANKX ( ALL ( opportunities[Opportunity Name] ), CALCULATE ( SUM ( opportunities[Expected Annual Revenue] ), ALLEXCEPT ( opportunities, opportunities[_ownerid_value], opportunities[Opportunity Name] ) ) )EDIT: You want to Rank the Opportunity Names for each Owner!
I think that's what you meant? :smileyhappy:
Your RANK formula works as a MEASURE not a COLUMN
If you want a column in the Data View - this should work
Owner Opportunity Rank =
RANKX (
ALL ( opportunities[_ownerid_value] ),
CALCULATE (
SUM ( opportunities[Expected Annual Revenue] ),
ALLEXCEPT ( opportunities, opportunities[_ownerid_value] )
)
)Good Luck! :smileyhappy:
Thanks Sean for the quick reply.
I think this is on the right track, but I believe this is ranking the owner himself. I am looking for the opportunity rank by the user. The rank should be determined by expected revenue. So I am looking for the "Owner Opportunity Rank" column here..
| _ownerid_value | Expected Annual Revenue | Opportunity Name | Owner Opportunity Rank |
| aaaa-1 | $ 100.00 | Opp1 | 2 |
| aaaa-1 | $ 200.00 | Opp2 | 1 |
| aaaa-2 | $ 400.00 | Opp3 | 2 |
| aaaa-2 | $ 500.00 | Opp4 | 1 |
Owner = aaaa-1 has two opportunites. Opp2 has a greater revenue than Opp1 so the Onwer Opportunity Rank = 1 for Opp2 and so forth... I apologize if that is not clear in my first post.
I when I read the RANKX documentation, I feel like this should be the column:
Owner Opportunity Rank = RANKX (
ALL ( opportunities[_ownerid_value] ),
opportunities[Expected Annual Revenue]
)
But I still get all 1's...
- Sean9 years agoCommunity Champion
How about this?
Owner Opportunity Rank = RANKX ( ALL ( opportunities[Opportunity Name] ), CALCULATE ( SUM ( opportunities[Expected Annual Revenue] ), ALLEXCEPT ( opportunities, opportunities[_ownerid_value], opportunities[Opportunity Name] ) ) )EDIT: You want to Rank the Opportunity Names for each Owner!
I think that's what you meant? :smileyhappy:
- kfinn9 years agoFrequent Visitor
Yes- This is what I am looking for. I am not following how DAX is grouping by the _ownerid_value but now that I have the acceptable solution, I can play around with it. Much thanks to you!!