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
Shpongle
Helper III
Helper III

Sorting clustered column by priority then date

Hi gang,

 

I've looked. I've tried. I'm stumped! I've read through loads of links on sorting clustered columns but I'm not getting it.

 

I think my date table skills are still pretty weak because I keep getting stuck when trying to figure out how to use it effectively... Below I have a clustered column chart (the bottom one) and the sort order of the X-Axis is great (by Priority). The sort order of the legend that comprises the data in the Axis is not great. I'm trying to sort the columns by date but apparently it's sorting alphabetically:

 

LegendSortQ.png

The field in the legend (Timeframe aka "YearMonthShort") is Text. When I change it to Date type in the table editor, it changes the content of the field to day/month name/year, which then makes the legend look nuts.

 

I want the legend to show the year/month in proper order!

 

HALP 🙂

 

Thanks in advance,

 

Mitch 

2 REPLIES 2
mahoneypat
Employee
Employee

On your Date table, add a column that shows the YearMonth in numeric format (e.g., 201901).  Then select the YearMonth column used in your visual and choose Sort By Column and select your numeric column.  That will make them show in correct order.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


OK - I just got a little bit smarter about date tables. I never observed the "format" option for when I changed a column to date type. I just updated the column in my date table to Date type and then adjusted the format to match and VOILA. It worked as desired.

 

Thanks for pointing me in the right direction!

 

Regards,

 

Mitch 

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.