Forum Discussion

JDeMaro22's avatar
JDeMaro22
Frequent Visitor
3 years ago

Custom sort X axis Values on Line Chart

Hello,

 

My CEO would like the Date X-Axis values to read Dec-April 2022 then Jan-March 2023. How can I custom sort these values? 

 

Thanks for your time,

 

 

4 Replies

  • Syk's avatar
    Syk
    Resident Rockstar

    You SHOULD tell the CEO "No". It makes no sense and will confuse anyone looking at the graph.

    But, you can create a calculated column to and sort your date based on the new column.

     

    • JDeMaro22's avatar
      JDeMaro22
      Frequent Visitor

      What would the calcuated column consist of to sort this accordingly?

      • Syk's avatar
        Syk
        Resident Rockstar

        For such a specific sorting it would have to be something like 
        if year = 2022 and month = December -> 1
        if year = 2022 and month = November -> 2
        and so on until you get the desired result

  • JDeMaro22's avatar
    JDeMaro22
    Frequent Visitor

    Syk 

     

    I tried writing it but I'm not good with DAX yet. So its an IF formula = year, month = 1