Forum Discussion
Anonymous
3 years agoNot applicable
Ranking using partition from relationship
I have a table of item details, and a table of events, which are either good or bad (1 or 0). There is a one-to-many relationship between 'Details'[Item ID] and 'Events'[Item ID]
I'm trying to write measures that will rank each Item ID by Sum(Good/Bad), partitioned by the Item Owner, and an overall ranking.
Any filters on the visual/page should affect the ranking.
Details
| Item ID | Owner |
101 | Dave |
| 102 | Jeff |
| 103 | Jeff |
| 104 | Jeff |
| 105 | Dave |
| 106 | Jeff |
Events:
| Item ID | Good/Bad |
| 101 | 1 |
| 101 | 0 |
101 | 1 |
101 | 0 |
102 | 1 |
102 | 1 |
103 | 0 |
103 | 0 |
103 | 0 |
103 | 0 |
104 | 1 |
104 | 0 |
104 | 0 |
104 | 0 |
105 | 1 |
Desired Result:
| Item ID | Owner | Count | Good | Rank Overall | Rank by Owner |
101 | Dave | 4 | 2 | 1 | 1 |
| 102 | Jeff | 2 | 2 | 1 | 1 |
| 103 | Jeff | 4 | 0 | 5 | 3 |
| 104 | Jeff | 4 | 1 | 3 | 2 |
| 105 | Dave | 1 | 1 | 3 | 2 |
1 Reply
- ThxAlotSuper User