Forum Discussion

Gunglewack's avatar
Gunglewack
Icon for Microsoft Employee rankMicrosoft Employee
6 years ago
Solved

January is in the wrong place

Hi

How can I make January come after December in my chart? Of course, if looking at a whole calendar year, Jan does come before December, but how can I wrap Dec-19 to Jan 20 at this time of year?
I've tried all the sort order combinations, but chronological order is not working.

Thanks!

  • Hi Gunglewack ,

    Do you create a calendar table? If not, please create one using the formula below and then sort the "MonthName" column by the "Year & MonNum" column.

    Calendar = 
    VAR _calendar =
        CALENDAR ( "10/1/2019", "5/1/2020" )
    RETURN
        ADDCOLUMNS (
            _calendar,
            "Year & MonNum", YEAR ( [Date] ) & MONTH ( [Date] ),
            "MonthName", FORMAT ( [Date], "mmmm" )
        )
    

    Hope this can help you.

     

    Best Regards,

    Xue Ding

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

2 Replies

  • v-xuding-msft's avatar
    v-xuding-msft
    Icon for Community Support rankCommunity Support

    Hi Gunglewack ,

    Do you create a calendar table? If not, please create one using the formula below and then sort the "MonthName" column by the "Year & MonNum" column.

    Calendar = 
    VAR _calendar =
        CALENDAR ( "10/1/2019", "5/1/2020" )
    RETURN
        ADDCOLUMNS (
            _calendar,
            "Year & MonNum", YEAR ( [Date] ) & MONTH ( [Date] ),
            "MonthName", FORMAT ( [Date], "mmmm" )
        )
    

    Hope this can help you.

     

    Best Regards,

    Xue Ding

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

    • Gunglewack's avatar
      Gunglewack
      Icon for Microsoft Employee rankMicrosoft Employee

      Thanks for that.

      I'm using the web app, so can't add it in exactly that format, but added a constructed YY-MM column in my source data.