Forum Discussion
Sorting by Month as Text (Jan Feb Mar etc)
- 10 years ago
OK got it
https://support.powerbi.com/knowledgebase/articles/592116
Go to data (left hand side button) and click
Then go to the table to be sorted (right hand side)
You will need three columns in this calendar table for month
create
1 Main column (to set up the link column for Invoice Date)
CalendarInv = CALENDAR (MINX(Header, Header[Invoice Date]), today())
2 Column for month in text format
MonthT = FORMAT( CalendarInv[Date], "MMM")
3 Column for month in number format
MonthN = Month (CalendarInv[Date])
Then go to field list on the right hand side Click on MonthT
then go to modelling / sort by column and select MonthN
The final step is as follows
NB Creating calendar table
http://community.powerbi.com/t5/Desktop/Possible-Tip-Trick-Dynamic-Date-Dimension-Table/td-p/8462
Found an easier method.
1. Add a column 'Mth' = Jan, Feb, Mar... in the main data set which has the data to be analyzed. this column can be derived from the date column.
2. Create a new query (MTH_TAB) with 2 columns. Mth | Mth_No.
Mth = Jan, Feb, Mar, etc. Mth_No = 1, 2, 3, ..
3. Save and let Power BI create the Relationship between Mth column in the main dataset and the MTH_TAB.
That's it, you can sort by Mth_No in the visualization chart. Use Tab> Modelling and click on 'Sort By Coliumn' button while hightlighting the Mth_No column of MTH_TAB in the right sidebar.