Forum Discussion

aizamkamadin's avatar
aizamkamadin
Icon for Helper II rankHelper II
4 years ago
Solved

ranking the measure value

i have one table that have 3 columns
1. country
2. Score
3. Rank

 

then i create a measure to calculate average(Score for few group of country.. e.g Europe, APAC, 
my question is how to rank the measure value(average) inside the above list OR

can we create the measure to calculate the rank

 

e.g

AvgValue for Europe = 49.90

Country   Score   Rank
Austria    50.80     21
Australia 50.20     22
Estonia   49.50     23

>>> wanted result.. rank for "avgValue for Europe" = 23

  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi aizamkamadin ,

     

    Here's how I approached the process for your reference.

    Suppose I have a table like this.

    Make a copy in Power Query Editor, select the [Country] and [Continent] columns and execute Unpivot Columns.

    Remove unwanted columns.

    create two new measures.

    AVG OF SCORE = AVERAGE('Table2'[Score])
    RANKING = RANKX(ALLSELECTED('Table2'[Area]),[AVG OF SCORE])

    Attached PBIX file for reference.

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly -- How to provide sample data

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi aizamkamadin ,

     

    Here's how I approached the process for your reference.

    Suppose I have a table like this.

    Make a copy in Power Query Editor, select the [Country] and [Continent] columns and execute Unpivot Columns.

    Remove unwanted columns.

    create two new measures.

    AVG OF SCORE = AVERAGE('Table2'[Score])
    RANKING = RANKX(ALLSELECTED('Table2'[Area]),[AVG OF SCORE])

    Attached PBIX file for reference.

     

    Best Regards,
    Gao

    Community Support Team

     

    If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

    How to get your questions answered quickly -- How to provide sample data