cancel
Showing results for
Did you mean:

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Helper V

## Silly ranking question

Hi,

I basically i have two columns:

Others 370

I want these values to be ranked so that anything that is not "Others" is ranked and presented in a descending order, but Others is presented as last. For example, if i rank the above alphabetically or by value, "Others" would be presented in the middle. This is wrong, it needs to be last. How do i rank everything except "Others"?

Thank you!

1 ACCEPTED SOLUTION
Super User

Please confirm that you created measures, not calculated columns.

Proud to be a Super User!

3 REPLIES 3
Super User

Try the following measures:

``````Total Amount = SUM ( RankTest[Amount] )

Company Rank =
VAR vAllValues =
ALL ( RankTest[Company] )
VAR vValuesToRank =
FILTER ( vAllValues, RankTest[Company] <> "Others" )
VAR vRowCount =
COUNTROWS ( vValuesToRank )
VAR vResult =
RANKX ( vValuesToRank, [Total Amount],, DESC, DENSE )
RETURN
IF ( MAX ( RankTest[Company] ) = "Others", vRowCount + 1, vResult )``````

Proud to be a Super User!

Helper V

I'm getting the same Rank (1) for all of these. I think the formula is making SUM for entire "Amount" column which is the same for all values. Am i doing something wrong? In the example, the Total Amount = SUM(RankTest[Amount])=1620 for all values. Therefore the rank is the same for all.

Super User

Please confirm that you created measures, not calculated columns.

Proud to be a Super User!

Announcements

#### Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

#### Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

#### Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors