Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply

Calendar Month not in order

Hi there,

 

In all of my visuals, the month is not in order:

 

findingsolution_0-1634705906533.png

 

 

This is what I'm using for my date table:

 

Date =
VAR MinYear = YEAR( MIN( Income[Date] ))
VAR MaxYear = YEAR ( max(Income[Date] ))
RETURN
ADDCOLUMNS (
FILTER (
CALENDARAUTO( ),
AND ( YEAR ( [Date] ) >= MinYear, YEAR ( [Date] ) <= MaxYear )
),
"Calendar Year", YEAR ( [Date] ),
"Month Name", FORMAT ( [Date], "mmmm" ),
"Month Number", MONTH ( [Date] ),
"Weekday", FORMAT ( [Date], "dddd" ),
"Weekday number", WEEKDAY( [Date] ),
"Quarter", "Q" & TRUNC ( ( MONTH ( [Date] ) - 1 ) / 3 ) + 1
)
 
it is only Oct Nov and Dec that are not in order and right behind Jan, and the rest are in order after that. 
 
Thanks for the help in advance!
1 ACCEPTED SOLUTION
VahidDM
Super User
Super User

Hi @findingsolution 

 

Use this:

 

Date =
VAR MinYear = YEARMINIncome[Date] ))
VAR MaxYear = YEAR ( max(Income[Date] ))
RETURN
ADDCOLUMNS (
FILTER (
CALENDARAUTO( ),
AND ( YEAR ( [Date] ) >= MinYearYEAR ( [Date] ) <= MaxYear )
),
"Calendar Year"YEAR ( [Date] ),
"Month Name"FORMAT ( [Date]"mmmm" ),
"Month Number", FORMAT(MONTH ( [Date] ),"0#"),
"Weekday"FORMAT ( [Date]"dddd" ),
"Weekday number"WEEKDAY[Date] ),
"Quarter""Q" & TRUNC ( ( MONTH ( [Date] ) - 1 ) / 3 ) + 1
)
 
And sort the Month Name column with Month Number.
 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!!


View solution in original post

1 REPLY 1
VahidDM
Super User
Super User

Hi @findingsolution 

 

Use this:

 

Date =
VAR MinYear = YEARMINIncome[Date] ))
VAR MaxYear = YEAR ( max(Income[Date] ))
RETURN
ADDCOLUMNS (
FILTER (
CALENDARAUTO( ),
AND ( YEAR ( [Date] ) >= MinYearYEAR ( [Date] ) <= MaxYear )
),
"Calendar Year"YEAR ( [Date] ),
"Month Name"FORMAT ( [Date]"mmmm" ),
"Month Number", FORMAT(MONTH ( [Date] ),"0#"),
"Weekday"FORMAT ( [Date]"dddd" ),
"Weekday number"WEEKDAY[Date] ),
"Quarter""Q" & TRUNC ( ( MONTH ( [Date] ) - 1 ) / 3 ) + 1
)
 
And sort the Month Name column with Month Number.
 

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.

Appreciate your Kudos!!


Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.