Forum Discussion
findingsolution
Helper I
4 years agoCalendar Month not in order
Hi there, In all of my visuals, the month is not in order: This is what I'm using for my date table: Date = VAR MinYear = YEAR( MIN( Income[Date] )) VAR MaxYear = YEAR ( m...
- 4 years ago
Use this:
Date =VAR MinYear = YEAR( MIN( Income[Date] ))VAR MaxYear = YEAR ( max(Income[Date] ))RETURNADDCOLUMNS (FILTER (CALENDARAUTO( ),AND ( YEAR ( [Date] ) >= MinYear, YEAR ( [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!!
VahidDM
Super User
4 years ago
Use this:
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", 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!!