Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
twister8889
Helper V
Helper V

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
1 ACCEPTED SOLUTION

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

View solution in original post

2 REPLIES 2
v-xulin-mstf
Community Support
Community 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
)

v-xulin-mstf_0-1623660175937.png

 

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!

 

 

 

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.