Forum Discussion
Anonymous
5 years agoNot applicable
Another sort by date problem
Hi.
Im going crazy trying to just get the date table to be sorted correctly
I used this dax:
Calendar =
var _calendar = CALENDAR("1/1/2020", "12,31,2023")
return
ADDCOLUMNS(_calendar, "Year", YEAR([Date]), "Month Number", MONTH([Date]),"Month", FORMAT([Date], "mmmm"), "Quarter", "QTR "&FORMAT([Date], "Q"), "Quarter Number", FORMAT([Date],"Q"))
But it just wont sort correctly, I sort by column "Month Number" but it keeps starting with the number 7 instead of 1
Any ideas?
Follow these steps:
4 Replies
- MURTAZAResolver I
Anonymous
A quick way to resolve this is to use Power BI generated Date Hierarchy, instead of using newly created columns.- AnonymousNot applicable
and how do I do that?
- MURTAZAResolver I
Follow these steps:
- mahoneypatMicrosoft Employee
Your DAX table expression worked fine for me, including the Sort By column. Please see this article/video on how to create Date tables that don't need to be sorted. There is one you can copy/paste and use directly.
No Sort Date Tables! – Hoosier BI
Pat