Forum Discussion

rosscortb's avatar
rosscortb
Post Patron
7 years ago
Solved

Help sorting column order

Hello,

 

Hoping you can help, might not have done this correctly but here's where I am. I  have two date columns, start and end. Shown as i.e 01 Feburary 2015.

In then needed to change the format  so created two new columns with the measure of 

Start Date Year Mon = FORMAT('Job Positions'[Start_Date],"MM/YYYY")
End Date Year Mon = FORMAT('Job Positions'[End_Date],"MM/YYYY")
 
so now shows as 02/2015
Now, I needed to create another column to join these together so I have
 
Start Date and End Date = CONCATENATE('Job Positions'[Start Date Year Mon],CONCATENATE(" ~ ",'Job Positions'[End Date Year Mon]))
 
so shows something like 02/2015 ~ 03/2016
 
Problem is how to do a Sort by Column so that the Current Job Position is at the tob and previous job below and so on, in a table. Is it because its a text field I can't do it?
  • Hi rosscortb 

    It could not work when you sort the same value[Start Date and End Date] by different values[Start Date].You may use sort by 'Start Date Mon' as below green part.

    Regards,

6 Replies

      • HotChilli's avatar
        HotChilli
        Community Champion

        Ah, fine.  Error messages are usually helpful.

        The message says it doesn't know how to sort because start date is not unique 'enough', that is, the same start date exists for different 'start and end date' values.

        So you need to find a way of making it unique, maybe add a calculated column (number) to sort by, constructed from the 'start and end date' field like yyyymmdd from start date and append yyyymm  from end date.  Just an idea, i haven't tested it.

  • jthomson's avatar
    jthomson
    Solution Sage

    Really don't get what you're asking exactly - you go on about concatenating a couple of columns together then go off on a complete tangent, can you clarify what you're actually wanting?

  • v-cherch-msft's avatar
    v-cherch-msft
    Microsoft Employee

    Hi rosscortb 

    It could not work when you sort the same value[Start Date and End Date] by different values[Start Date].You may use sort by 'Start Date Mon' as below green part.

    Regards,
    • rosscortb's avatar
      rosscortb
      Post Patron

      Thanks for your help v-cherch-msft , wasn't aware that you could join the columns that way. Thanks again.