Forum Discussion
ONYAND
6 years agoFrequent Visitor
RANKX AND AGGREGATION OF RESULT
I am having an issues ranking a set of rows then getting the total to use as input to another calculation. I have attempted nested CALCULATE statements and intermediate table using CALCULATETABLE unsuccessfully.
Scenario is as follows:
Original table
| Item | Sales |
| A | 3 |
| B | 1 |
| B | 4 |
| C | 2 |
| D | 7 |
| E | 5 |
| E | 1 |
Ranking top N (3)
| Item | Sales |
| D | 7 |
| E | 6 |
| B | 5 |
| TOTAL | 18 |
In this example, I am interested in the value 18 for onward processing. Take note that Item E & B have 2 rows each and therefore an aggregation logic needs to be applied beforing ranking