Forum Discussion

Bultark's avatar
Bultark
New Member
7 years ago
Solved

Ranking Issues

Hi All,

 

I've been trying out examples in previous posts, but I don't seem to have found the solution to my Ranking issue. 

 

My data looks line like the following

 

ID   Person     Period     Value    Mark

1     Bob         1              100      1

1     Andy       1              150      2

1     Matt        1              200      3

1     Jon          1              0          0

1     Bob         2              100      1

1     Andy       2              200      3

1     Matt        2              150      2

1    Jon           2                0        0

1     Bob         3              100      1

1     Andy       3              200      3

1     Matt        3              150      2

1     Jon          3               0         0

1     Bob         4              200      3

1     Andy       4              100      1

1     Matt        4              190     2

1     Jon          4              0         0

 

The end result would be I'm looking for is the following, there would then be ID 2, ID 3 all with different figures but all with different rankings for them.  

 

Person      Rank     Total Mark    Total Value

Matt           1           9                   690

Andy          2           9                   650

Bob            3           6                   500

Jon             4           0                       0  

 

The issues I have is that at the moment all my rankings show as 1 or some other random number. 

  • i'm not sure to understand u but try this

    if u want to get the table

    use this query

    rank = 
    var total = SUMMARIZE(tableName;[Person];"Total Mark";SUM(tableName[Mark]);"Total Value";SUM(tableName[Value]))
    return 
    ADDCOLUMNS(total;"rank";RANKX(total;[Total Value];;DESC;Dense))

     

1 Reply

  • i'm not sure to understand u but try this

    if u want to get the table

    use this query

    rank = 
    var total = SUMMARIZE(tableName;[Person];"Total Mark";SUM(tableName[Mark]);"Total Value";SUM(tableName[Value]))
    return 
    ADDCOLUMNS(total;"rank";RANKX(total;[Total Value];;DESC;Dense))