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
cmengel
Advocate II
Advocate II

Get It Sorted

Get It Sorted!

Sort One Column by Another Column

 

Work on a report this week had me solve a sort order issue.

 

The column chart visual had MONTH_YEAR on the x-axis from the date table - e.g. "Apr-2022" - very common, very easy to read and understand.

Thing was, the sort order wasn't right.  Turned out the MONTH_YEAR column was sorted based on the MONTH_YEAR_NUM column (i.e. 42022).  It did sort correctly, but wasn’t what I wanted or needed.

 

In Power Query, I created a new column - YEAR_MONTH_NUM (i.e. 20224).  The order/sequence of the digits made a BIG difference - year first then month.  It was better, but still not right.

 

The final key to the puzzle was to ensure the month numbers were all TWO digits - 202204.  NOW everything was good and worked the way I needed AND wanted!

 

When you sort one column in a table by another column(s), make sure the values in those columns are what you need to get the sort order you desire.

1 REPLY 1
v-janeyg-msft
Community Support
Community Support

Hi, @cmengel 

 

I'm glad you solved the sorting problem by yourself. If you are willing to share your case specifically, or summarize your solutions in one sentence and reply below, you can mark your answer as solution to help the other members find it more quickly.

 

Best Regards,
Community Support Team _ Janey

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.