Forum Discussion

fb198's avatar
fb198
Regular Visitor
2 years ago
Solved

Month name not sorting correctly despite Sorting by another column

Hi,    I have a column in my Calendar Table with values like 'Jan 2024', 'Feb 2024', 'Mar 2024' and so on. I have sorted with a Custom Index called Sort_Index. Despite Sorting it by another column....
  • rajendraongole1's avatar
    2 years ago

    Hi fb198 - as per my understanding card visual doesn't respect the custom sort order applied to your month column. Even though you've already sorted your MonYear column using the Sort_Index column, the card visual might still be picking the first value alphabetically instead of following the custom sort order.

    create a measure to get the card visual as per monthname order instead of alphabitical 

     

    Selected Month =
    CALCULATE(
        FIRSTNONBLANK('DateTab'[MonthYear], 1),
        FILTER(
            'Datetab',
            'DateTab'[MonthNumber] = MINX(ALL('Datetab'), 'DateTab'[MonthNumber])
        )
    )
     
    In above measure i have month number to sort it , in your case you can change it to sortindex column or monthnumber also fine.
     
    Hope it works.