Forum Discussion

findingsolution's avatar
4 years ago
Solved

Calendar 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...
  • VahidDM's avatar
    4 years ago

    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!!