Forum Discussion

twister8889's avatar
twister8889
Icon for Helper V rankHelper V
5 years ago
Solved

Order column text and number

Hi guys,

 

I have a Column with text and numbers values, this column was created in power query, I would like to order this column by the first line with text value (Due) and order by number for others values, its is possible?

 

ColumnResult
DueDue
31/12/202101/07/2021
31/10/202501/09/2021
31/10/202401/10/2021
31/10/202301/12/2021
31/10/202201/12/2025
31/08/202402/07/2021
31/08/202331/08/2023
02/07/202131/08/2024
01/12/202531/10/2022
01/12/202131/10/2023
01/10/202131/10/2024
01/09/202131/10/2025
01/07/202131/12/2021
  • twister8889's avatar
    twister8889
    5 years ago

    First of all, thank you for your answer...
    I solved the problem, creating the new column in power query to sort the columns

2 Replies

  • v-xulin-mstf's avatar
    v-xulin-mstf
    Icon for Community Support rankCommunity Support

    Hi twister8889,

     

    When a column contains both text and values, the entire column will be in text format.You define the value of the text first, and then sort the whole column

    Just like:

    Column = 
    SWITCH(
        'Table'[Column1],
        "Due",1,
        "Text1",2,
        "Text2",3,
        0
    )

     

    Best Regards,

    Link

     

    Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!

     

     

     

    • twister8889's avatar
      twister8889
      Icon for Helper V rankHelper V

      First of all, thank you for your answer...
      I solved the problem, creating the new column in power query to sort the columns