Forum Discussion
rkh
6 years agoNew Member
Sorting by Month as Text (Jan Feb Mar etc)
I used Format to get mmmyy from Date. But in reports, data is being sorted alpha. I want mmmyy sorted by month
- 6 years ago
You need to create a sort column and use that as sort column for month
Month sort = format(Date[Date],"MM")
Month Year sort = format(Date[Date],"YYYYMM")
v-alq-msft
Community Support
6 years agoHi, rkh
You can also create two calculated columns as follows.
Month-Year = FORMAT('Table'[Date],"mmm-yy")
SortColumn =
var _month = MONTH('Table'[Date])
var _year = YEAR('Table'[Date])
return
COUNTROWS(
FILTER(
ALL('Table'),
MONTH('Table'[Date])>_month&&
YEAR('Table'[Date])=_year
)
)+1
Then you can make 'Month-Year' column selected, go to 'Modeling' ribbon, click 'Sort by Column', check 'SortColumn'.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.