Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
rosscortb
Post Patron
Post Patron

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?
sortbucolumn.PNG
1 ACCEPTED SOLUTION
v-cherch-msft
Employee
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.

a1.png
Regards,
Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
v-cherch-msft
Employee
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.

a1.png
Regards,
Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

jthomson
Solution Sage
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?

HotChilli
Super User
Super User

When you say 'Sort by Column' hopefully you know about https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column#sort-using-the-sort-by-column-butto...

 

and you could use the job positions[start date]

Yeah, wouldn't let me use Start Date.

 

sort1.PNG

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.