Forum Discussion
XhevahirMehalla
Helper IV
3 months agoUnable to sort by Month using Date table which I created
Hello -
I have a classical case when I am unable to show months in right Order even though I am trying the right thing and setup to accomodate that.
I have a date table which I created as:
Date =
ADDCOLUMNS (
CALENDAR ( DATE ( 2025, 12, 1 ), DATE ( 2026, 12, 31 ) ),
"Year", YEAR ( [Date] ),
"Month_No", MONTH ( [Date] ),
"Month", FORMAT ( [Date], "MMMM" ),
"Month_Short", FORMAT ( [Date], "MMM" ),
"Month_Key", YEAR ( [Date] ) * 100 + MONTH ( [Date] ),
"Quarter", "Q" & QUARTER ( [Date] ),
"Month_Start_Date", DATE ( YEAR ( [Date] ), MONTH ( [Date] ), 1 ),
"Month_End_Date", EOMONTH ( [Date], 0 ),
"Year_Quarter", FORMAT ( [Date], "YYYY" ) & " Q" & QUARTER ( [Date] )
)
I tried few things:
- Data tried to sort by Month_key - and it shows an error.
- I tried to sort by in the visual - still not change.
My visuals are not sorted correctly.
What I am missing? what else to do?
I need help!
Thanks
Xhev
You need to sort the month column by month number, not month key. December 2025 and December 2026 will have different month keys, but the same month number.
2 Replies
- johnt75
Super User
You need to sort the month column by month number, not month key. December 2025 and December 2026 will have different month keys, but the same month number.
- XhevahirMehalla
Helper IV
Thanks Jonh! I worked!