Forum Discussion
Monthname not sorting in unpivot columns
Hi,
I have a matrix in power bi where I want to show from the slicer if Year is selected only year should show, if Quarter then Quarter should show on the matrix and when month is selected MonthName should show. I have created a table with unpivot columns and the monthname is not sorting. Everything else works except the sorting. Please help. Thanks Dorathy
11 Replies
- Greg_Deckler
Community Champion
Sample data would help. But you likely need a numeric month column and use Sort By column on you monthname. Otherwise it will sort alphabetically. - parry2k
Super User
Anonymous you have to sort month name by month number, assuming you have month like Jan, Feb, Mar and month number 1, 2, 3,...
Select month name column and on column tools choose sort by , see example below, it is not exactly the same column but shows where the option are to sort by
- amitchandak
Super User
If your month is in MMM-YYYY or MMMM-YYYY format then you need a month year sort column
New column
Month Sort =format(date[date],"YYYYMM")
https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column
- AnonymousNot applicable
Slicer
Day
Year
Quarter
MonthName
Week
Day
If Monthname is selected the Matrix shows as
Department Apr 20 Feb 20 Mar 20 Jan 20
- parry2k
Super User
Anonymous add another column for sorting month-year column and sort column
Month Year Sort = FORMAT( Table[Date], "YYYYMM" )sort your month year column with above new column called Month Year Sort