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
Anonymous
Not applicable

Sort Column by Date Created

Hi all,

 

I have a line chart which we have made into a control chart for viewing the total days it has taken to complete a project. We have the total days as the value and we also have a lower control, upper control, average, business limit and outside limit lines. The requirement is for the project numbers to be on the Axis but the project numbers have to be sorted by the date they have been created. 

Can anyone tell me how to do this? I cannot sort the project number column by the date field or an index as i have the error 'There can't be more than one value in 'Date' for the same value in 'Project Number'Control Chart.PNG

1 ACCEPTED SOLUTION
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Based on your description, an project number corresponds to multiple dates, which cannot be sorted. But if you want to sort by the latest date of each project number, this is OK. Create a column in query editor to calculate latest date of each project number, and sort the project numbers according to this column.

V-lianl-msft_2-1611641634374.pngV-lianl-msft_3-1611641646050.pngV-lianl-msft_4-1611641654170.png

 

 

Sample .pbix

 

Best Regards,
Liang
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

3 REPLIES 3
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Based on your description, an project number corresponds to multiple dates, which cannot be sorted. But if you want to sort by the latest date of each project number, this is OK. Create a column in query editor to calculate latest date of each project number, and sort the project numbers according to this column.

V-lianl-msft_2-1611641634374.pngV-lianl-msft_3-1611641646050.pngV-lianl-msft_4-1611641654170.png

 

 

Sample .pbix

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , if you are getting this error, means project number have more than one date created or two projects have the same date.

 

Create a column like this and try to sort on that

Project date =  format([created_date],"YYYYMMDD") & [project]

 

But this will help only in case when project has one created date

Anonymous
Not applicable

Thanks @amitchandak, unfortunatly the Project Numbers are used several times so there is more than one date.

 

Does this mean it is not possible to sort the Project Number by Date created? Or is there maybe another way to do this?

 

Thanks

Donna

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.