Forum Discussion

hkpowerbi's avatar
hkpowerbi
Regular Visitor
9 years ago

Month and year field

Hi All,

I have a separate field from the DB for month, another for year. Both of these are text fields, and not date/time. When I bring in month into a visualization, it is sorting by alphabetical order. Any way to get it to sort by Jan, Feb, March, etc? Any workaround? Thanks

2 Replies

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi hkpowerbi,

     

    We could add a column "MonthNum", then sort month by "MonthNum". It would work.

    1. Add "MonthNum" in Query Editor. (Add Conditional Column.)

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    2. Change the type of "MonthNum" into "Whole Number".

    3. Click Month, click "Sort by column", choose "MonthNumber".

     

     

     

     

     

     

     

     

     

     

     

     

     

     

    Best Regards!

    Dale

  • v-jiascu-msft's avatar
    v-jiascu-msft
    Icon for Microsoft Employee rankMicrosoft Employee

    Hi hkpowerbi,

     

    Could you please mark the proper answer if it's convenient for you? That will be a help to others.

     

    Best Regards!
    Dale