Forum Discussion
rajivraina
Helper II
7 years agoRanking data across multiple categories within same column
Hi, I have a table of data that has macroeconomic data on countries over a period of years. I am trying to assign a rank to each country based on their value, while still taking into account the ...
Zubair_Muhammad
Community Champion
7 years ago
Try this MEASURE.
See the attached file as well with your sample data
Measure =
RANKX (
CALCULATETABLE (
Table1,
ALLEXCEPT ( Table1, Table1[ Grouping ], Table1[ Indicator ], Table1[ Year ] )
),
CALCULATE ( SUM ( Table1[ Value ] ) ),
,
DESC,
DENSE
)
rajivraina
Helper II
7 years ago
Zubair_Muhammad wrote:
Try this MEASURE.
See the attached file as well with your sample data
Measure = RANKX ( CALCULATETABLE ( Table1, ALLEXCEPT ( Table1, Table1[ Grouping ], Table1[ Indicator ], Table1[ Year ] ) ), CALCULATE ( SUM ( Table1[ Value ] ) ), , DESC, DENSE )
Zubair_Muhammad This is the result for me...it looks like it is ranking correctly according to the value but it is not taking into account Year or Grouping or Indicator. The highest rank should be around 200-300 as that is the max # of countries. Any idea what's going on?
- Zubair_Muhammad7 years ago
Community Champion
Could you share file or full data- rajivraina7 years ago
Helper II
Zubair_Muhammad Can I send you the file in a private message? If not, I can post here but would rather avoid that.
Thanks,
-Raj