0
votes

I am trying to rank my table values as 1,2,3,4,5 etc however when using the RANKX function I have noticed that if my values are the same for example 4 values are 25 then the ranking would be for example 1 for all 4 of those values. But I would want them to be 1,2,3,4 etc.

enter image description here

I have used this DAX measure: enter image description here

The values are commonly going to be the same for multiple "short descriptions" I am not bothered about the order of the ranking if they are the same. Just making sure the rank rating is in order from 1-15.

Any thoughts?

Thanks

1
In SQL, you would use ROW_NUMBER()instead of RANK(). It is not clear if you want a SQL solution.Gordon Linoff
@GordonLinoff Within Power BI would be preferableCraksyGB
are you sure you want rank or row number? I don't see anything wrong with the example, the values with 25 should be ranked 1 as it's not specified how to break the tie. If you want the row number, you can add a index column using power querymonte
I am wanting to show the top 5 "Short Description" based on the highest rating.CraksyGB

1 Answers

0
votes

If it is possible in your case to do the Aggregation in Power Query part, you can create your row_number/index there as well. If I guess correct, your value in column Fifth Value is measure and you are doing aggregation with a group by applied on value Short Description. So you are getting Sort Description wise Fifth Value and you need a row number based on values for Fifth Value, right?

If the above is correct, you have to do the Sort Description wise aggregation in Power Query and add the Index there for your filtering purpose in the report.