Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Number ordering issue (1,11,2,AB)

Hi all, I have issue with my number ordering. I have the following data (and the table will have more rows): Day Name Code 1 1-ABC 1 1 2-ABC 1 1 3-ABC 10 1 4-ABC 11 ...
  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi all,

    I just found the solution in another post. I used the following dax formula and it worked:

    Sort_Order =
    IF (
        NOT ( ISERROR ( 'Table'[Column] + 0 ) )
            = TRUE ();
        CONCATENATE ( REPT ( 0; 4 - LEN ( 'Table'[Column] ) ); 'Table'[Column] );
        'Table'[Column]
    )

     You can refer to the following post:  https://community.powerbi.com/t5/Desktop/Number-sorting-in-text-format/m-p/237256

    Thank you for the help.