Forum Discussion

JDeMaro22's avatar
JDeMaro22
Frequent Visitor
3 years ago

How to sort Quarters in Bar Chart?

Hello,

 

I have a bar chart my CEO needs this afternoon but I don't know how to sort the X axis by quarters. I need it to read Q1-2022, Q2, Q3, Q4 then Q1 2023. I'm sure it can be down within the data itself but I'm not sure how.

 

Thank you,

 

Joshua

 

 

 

 

5 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Icon for Community Champion rankCommunity Champion

    JDeMaro22 Going to depend on the structure of your data but in general construct a numeric column like this (DAX example):

     

    Quarter Sort = YEAR([Date]) * 100 + QUARTER([Date])

     

    Whatever your quarter column is, set it's Sort By column to this numeric column. Go to Data view, select your quarter column and in Column Tools set the Sort By column to Quarter Sort.

    • JDeMaro22's avatar
      JDeMaro22
      Frequent Visitor

      I apologize I'm new to writing DAX. I don't have a "date" column in this particular data set. In the picture above I'm using "ReferralStartQuarter". These are the date options I have:

       

       

    • JDeMaro22's avatar
      JDeMaro22
      Frequent Visitor

      Sorry, and this is the measure for the quarters:

      ReferralStartQuarter =
      CONCATENATE("Q",Quarter(MART_REFERRAL[ReferralDateMerged]))&"-"&Year(MART_REFERRAL[ReferralDateMerged])
      • Greg_Deckler's avatar
        Greg_Deckler
        Icon for Community Champion rankCommunity Champion

        JDeMaro22 Try:

        Quarter Sort Column in MART_REFERRAL Table = YEAR([ReferralDateMerged]) * 100 + QUARTER([ReferralDateMerged])