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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Column sorting issue in Power Bi

HI, 

 

Can somebody help me with this sorting issue?

I cannot do it with the regular sorting solution, as it sorts just the first digit, then the second and so on. I am trying to sort the Aging column. 

 

Thank you. 

 

Sorting issue.png

2 ACCEPTED SOLUTIONS
MartynRamsden
Solution Sage
Solution Sage

Hi @Anonymous 

 

Create a calcualted column in the same table as your 'Aging RW' column:

AgingRW Sort = 
SWITCH ( 
    Table1[Aging RW),
    "0-30", 1,
    "31-60", 2,
    "61-90", 3,
    "91-120", 4,
    "121-150", 5,
    "151-180", 6,
    "180+", 7,
    8
)

 

Then, in the 'Column tools' sub-menu, sort your Aging RW column by your new column.

For more info, see about half way down this page: docs.microsoft.com/en-us/power-bi/desktop-sort-by-column 

 

Best regards,

Martyn

 

If I answered your question, please help others by accepting it as a solution.

View solution in original post

amitchandak
Super User
Super User

Create a new sort column in the table and mark that as the sort column.

Sort_by_column.png

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

 

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Thank you Martyn. 

It would have worked in normal circumstances, but my column was already sorted and cannot do it. Tried combining all possibilities. See pic below. 

I have no idea what to do next. 

 

sorting issue 2.png

amitchandak
Super User
Super User

Create a new sort column in the table and mark that as the sort column.

Sort_by_column.png

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges

Connect on Linkedin

 

Anonymous
Not applicable

Hi Amitchandak, 

 

IT would have worked, if the column wasn't already sorted. Please see below the printscreen:

sorting issue 3.png

MartynRamsden
Solution Sage
Solution Sage

Hi @Anonymous 

 

Create a calcualted column in the same table as your 'Aging RW' column:

AgingRW Sort = 
SWITCH ( 
    Table1[Aging RW),
    "0-30", 1,
    "31-60", 2,
    "61-90", 3,
    "91-120", 4,
    "121-150", 5,
    "151-180", 6,
    "180+", 7,
    8
)

 

Then, in the 'Column tools' sub-menu, sort your Aging RW column by your new column.

For more info, see about half way down this page: docs.microsoft.com/en-us/power-bi/desktop-sort-by-column 

 

Best regards,

Martyn

 

If I answered your question, please help others by accepting it as a solution.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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