Forum Discussion

corange's avatar
corange
Icon for Post Patron rankPost Patron
7 years ago

Ascending order - Chart

Hi everyone,

 

I am stuck on something.  I have a chart representing the tenure of our employees over the years. I have used a formula to obtain the result. The formula I used is : EMPLOYMENT LENGTH = IF(Drivers[Concatenate Length]= "0 MONTHS", "MONTHS", IF(Drivers[Concatenate Length] <> "0 MONTHS", Drivers[Concatenate Length]))

 

I dont understand why my chart is not in ascending order. As you can see 6 years is before 4 years etc. I don't know how to fix this. Could you please haave a look and let me know if I am missing something? I have used the sorting option of the chart without any success.

 

Thanks in advance.

 

6 Replies

  • corange what is cocatenate length? Are you using Employment Lenght  in chart? I just made small change to your formula, you don't need 2nd condition

     

    EMPLOYMENT LENGTH = IF(Drivers[Concatenate Length]= "0 MONTHS", "MONTHS",  Drivers[Concatenate Length])
    • corange's avatar
      corange
      Icon for Post Patron rankPost Patron

      Hi,

       

      Apologies for the lack of precision. I have created concatenate length to obtain the value of the employee tenure. The formula is as follows:

       

      Concatenate Length = CONCATENATE(CONCATENATE(Drivers[Length #]," "), Drivers[Length])

       

      Length = IF(Drivers[Length #]<=0, "MONTHS", IF(Drivers[Length #]=1, "YEAR", IF(Drivers[Length #]>1, "YEARS") ))

       

      Length # = DATEDIFF(Drivers[StartDate],Drivers[Finish Duplicate],YEAR)

       

      I am talking about the order of the legend. It is not in the rigth order. I have got other reports and there are all over the place. I have tried using the sorting function of my chart without success. Employment lenght is used in a charge.

       

      Thank you.

    • corange's avatar
      corange
      Icon for Post Patron rankPost Patron

      Hi Dina,

       

      Yes, I am talking about the legend. I have tried the sorting option of the chart without any success. It will only sort the legend randomly.

       

       

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

        corange can you share sample pbix file, remove any sensitive information before sharing. I would like to look at it. You can share by one drive/google drive or send me directly by email. My email is in my signature.