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
Reynan_s
Frequent Visitor

3 CHARS MONTH NOT SORTING CHRONOLIGICALLY

Hi Guys,

 

sample values:

YEAR   MONTH 

2021    JAN

 

First, in order to drill down, I transformed this to 'DD-MMM-YY'. I have no trouble sorting the months - they begin in January and end in December.

 

I'd like to reduce the Months to three characters alone. I followed some of the procedures mentioned here, such as adding a new column to convert the month to three characters and another column to set the counter part number before sorting the columns, but why isn't it working for me?

 

please see screen shots below

 

Current header

Reynan_s_0-1639625697557.png

 

just ingnore the column name..i forgot to alter to month_num 🙂

Reynan_s_1-1639625714073.png

 

Sort by Column

Reynan_s_0-1639626315391.png

 

 

TIA

 

 

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Reynan_s ,

I created some data:

vyangliumsft_0-1639983196038.png

Here are the steps you can follow:

Because the sorting rules of power bi are sorted in alphabetical order, A will appear in the first.

vyangliumsft_1-1639983196040.png

1. Use Enter data to create a table.

vyangliumsft_2-1639983196041.png

2. Select column [3], click Column tools-Sort by column-Column [lndex].

vyangliumsft_3-1639983196050.png

3. Connect the relationship between the two tables.

vyangliumsft_4-1639983196050.png

4. Place column [3] of Table2 into the matrix.

vyangliumsft_5-1639983196053.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

8 REPLIES 8
v-yangliu-msft
Community Support
Community Support

Hi  @Reynan_s ,

I created some data:

vyangliumsft_0-1639983196038.png

Here are the steps you can follow:

Because the sorting rules of power bi are sorted in alphabetical order, A will appear in the first.

vyangliumsft_1-1639983196040.png

1. Use Enter data to create a table.

vyangliumsft_2-1639983196041.png

2. Select column [3], click Column tools-Sort by column-Column [lndex].

vyangliumsft_3-1639983196050.png

3. Connect the relationship between the two tables.

vyangliumsft_4-1639983196050.png

4. Place column [3] of Table2 into the matrix.

vyangliumsft_5-1639983196053.png

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Thanks @v-yangliu-msft  🙂

Reynan_s
Frequent Visitor

I've tried to create a new table 

 

Reynan_s_0-1639631312071.png

 

Even after I sorted the the Month_no  it's still not sorting 😞

 

Reynan_s_1-1639631375566.png

 

 

 

amitchandak
Super User
Super User

@Reynan_s , I think you are marking that as date, keep it simple

 

Month sort = Month([Date])

 

Click on the month column, When that is selected. Click on sort column, Select Month Sort.

 

Add month to visual(Table/Matrix/Bar/Pie etc) , it should sort correctly.

 

It will not sort on data view using sort column

Reynan_s
Frequent Visitor

Sorry, still not working for 3 chars month

Reynan_s
Frequent Visitor

@amitchandak 

Done adding new columns

The Month2 is the   FORMAT([Date],"mmm" but why the  Month sort = FORMAT([Date],"mm") not converting to a whole number?

 

Reynan_s_0-1639627751246.png

 

 

Reynan_s
Frequent Visitor

@amitchandak  thanks for the reply and followed your reco

 

Still not sorting 😞

 

3_Month = UPPER(FORMAT('Table'[DateConv],"mmm"))

montth_sort = FORMAT('Table'[DateConv],"mm")
 
Reynan_s_1-1639627067862.png

 


 

amitchandak
Super User
Super User

@Reynan_s , You need create columns like

 

Month = FORMAT([Date],"mmm")
Month sort = FORMAT([Date],"mm")

 

Mark Month Sort as the sort column of Month

 

Sort Month.png

 

https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

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.