Forum Discussion

bdehning's avatar
bdehning
Icon for Post Prodigy rankPost Prodigy
2 years ago
Solved

Need to add add Month Sort Order to table

I have existing table with all Date Columns as Whole Numbers.   I introduced a Month Text Field for Column Charts, but now I need to be able to sort months in Month order.  

 

How do I accomplish that? 

 

 

4 Replies

    • bdehning's avatar
      bdehning
      Icon for Post Prodigy rankPost Prodigy

      Is there a way to add something to existing table to make this work?

      • Anand24's avatar
        Anand24
        Icon for Super User rankSuper User

        bdehning ,
        Add a calculated column to the existing table and sort month by that new sort column.
        Here's the DAX for the new calculated column:

        Month Sort Col = 
        SWITCH(
            MONTH(TableName[Date]),
            1, 1,
            2, 2,
            3, 3,
            4, 4,
            5, 5,
            6, 6,
            7, 7,
            8, 8,
            9, 9,
            10, 10,
            11, 11,
            12, 12
        )