Forum Discussion

Ania26's avatar
Ania26
Icon for Helper IV rankHelper IV
10 months ago
Solved

Sorting

Hello, I would like to have this measure: Rank Total C = IF('X'[TOP N Countries TC]<> BLANK(),RANKX(TOPN(SELECTEDVALUE('TOP N Selection'[Value]),ALLSELECTED('X'),[Total Total C]),[Total Total C],,D...
  • DataNinja777's avatar
    10 months ago

    Hi Ania26 ,

     

    You can use the 2025 year value to sort the bar chart in the descending order by creating a sorting measure like below and putting in the tooltip field.  

     

    Rank by Latest Year = 
    VAR CurrentCountry = SELECTEDVALUE('X'[Country]) // <-- Replace with your country column
    VAR RecentYearValue = calculate([Total Amount],'Calendar'[Year]=2025) // <-- Replace with your 2025 value measure
    
    RETURN
    IF(
        CurrentCountry = "Other",
        -999999999, // A very large negative number to push "Other" to the last position
        RecentYearValue
    )

    Then you can click on the three dot elipsis .... and select the measure above.

    The resultant out put is as shown above which is in line with your requirement.  

     

    I am attaching an example pbix file for your reference.

     

    Best regards,