How to order my notion chart by date ?
That's a question that we often get at Nochart. So we though that this would be an interesting article for you guys :)
Ordering your chart by date
Most of the time, ordering a notion chart by date in Nochart is straightforward to do:
- Select the date you want to order by :
![Select your date column in the order by select](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2F020f1e0f-2485-4c1e-a522-36307e5e802e%2F89730c95-a3b3-4bfd-bc54-8103a510d52f%2FUntitled.png%3Fid%3Db4eb64df-f931-4c66-b942-a0c77f41769f%26table%3Dblock%26spaceId%3D020f1e0f-2485-4c1e-a522-36307e5e802e%26expirationTimestamp%3D1722139200000%26signature%3DBtUkE6mJ8zOjbrxm8NPiekp8yhXwspeMCwXC8NS3-PM?table=block&id=b4eb64df-f931-4c66-b942-a0c77f41769f&cache=v2)
Ordering your chart when your column is not a date
But sometime, your month property in Notion is not set as a date.
![Here, Month text and Year type's is select. Not date.](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2F020f1e0f-2485-4c1e-a522-36307e5e802e%2F4c61f1e1-5061-4bb8-9e7f-b8e3a3ccc63e%2FUntitled.png%3Fid%3Dbff380f5-b271-4c1b-8516-9ad5e63e7b9c%26table%3Dblock%26spaceId%3D020f1e0f-2485-4c1e-a522-36307e5e802e%26expirationTimestamp%3D1722139200000%26signature%3DqQzM0lbi2TgHf724Wc7Ll3OJ_Xk-fsOGXN6NvkcPbsY?table=block&id=bff380f5-b271-4c1b-8516-9ad5e63e7b9c&cache=v2)
When your date is set as a select or a text, Nochart won't detect that it's actually a date and will treat it as a text and sort it alphabetically.
![And end up with Month in alphabetical order.](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2F020f1e0f-2485-4c1e-a522-36307e5e802e%2Ff29c2f52-f1e4-4963-92b4-4239754feaf4%2FUntitled.png%3Fid%3Da5c8fbf6-2a0e-4cf6-8a5e-d83b1bcf76ca%26table%3Dblock%26spaceId%3D020f1e0f-2485-4c1e-a522-36307e5e802e%26expirationTimestamp%3D1722139200000%26signature%3DGicun5wuK2AIjwwFVo4mbAzRI174FRTIHIZTzrj5uwU?table=block&id=a5c8fbf6-2a0e-4cf6-8a5e-d83b1bcf76ca&cache=v2)
In this case what you need, is to use formula in Notion in order to calculate the right date and use it to order your chart:![notion image](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2F020f1e0f-2485-4c1e-a522-36307e5e802e%2F0d2e7500-c786-4ba7-9ec0-c2ee6e77b2ed%2FUntitled.png%3Fid%3D3f50346d-5e20-4b92-a63b-e80e6e4d6b82%26table%3Dblock%26spaceId%3D020f1e0f-2485-4c1e-a522-36307e5e802e%26expirationTimestamp%3D1722139200000%26signature%3DZgEsre95GKlar1TEnaHpQAjruHGXckg4IE3drdW07mc?table=block&id=3f50346d-5e20-4b92-a63b-e80e6e4d6b82&cache=v2)
![notion image](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2F020f1e0f-2485-4c1e-a522-36307e5e802e%2F27d38bc3-b97c-4b5d-8946-60964bf9bba2%2FUntitled.png%3Fid%3D17e0d89e-83a7-4293-8a7c-c54761191e1c%26table%3Dblock%26spaceId%3D020f1e0f-2485-4c1e-a522-36307e5e802e%26expirationTimestamp%3D1722139200000%26signature%3DDohrzHDvLhRbCf0oBqeexPCdWTMn9MV1u_2sH-WoyBM?table=block&id=17e0d89e-83a7-4293-8a7c-c54761191e1c&cache=v2)
- Turn your month text into the number of the month by creating a new field named Calculated Month and use this formula:
if(prop("Month text") == "January", 1, if(prop("Month text") == "February", 2, if(prop("Month text") == "March", 3, if(prop("Month text") == "April", 4, if(prop("Month text") == "May", 5, if(prop("Month text") == "June", 6, if(prop("Month text") == "July", 7, if(prop("Month text") == "August", 8, if(prop("Month text") == "September", 9, if(prop("Month text") == "October", 10, if(prop("Month text") == "Novermber", 11, if(prop("Month text") == "December", 12, 1))))))))))))
Here is what you should obtain (8 for august, 9 September ...)![notion image](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2F020f1e0f-2485-4c1e-a522-36307e5e802e%2Fa5723e24-221e-47fd-9606-1c78d605cb33%2FUntitled.png%3Fid%3D7e5b4ed4-292e-4ed1-b907-b7708fe6be74%26table%3Dblock%26spaceId%3D020f1e0f-2485-4c1e-a522-36307e5e802e%26expirationTimestamp%3D1722139200000%26signature%3DP9tG8N33YejiR-s5nP_pi3ThTYT8NRg9zQDoal-vchQ?table=block&id=7e5b4ed4-292e-4ed1-b907-b7708fe6be74&cache=v2)
![notion image](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2F020f1e0f-2485-4c1e-a522-36307e5e802e%2Fa5723e24-221e-47fd-9606-1c78d605cb33%2FUntitled.png%3Fid%3D7e5b4ed4-292e-4ed1-b907-b7708fe6be74%26table%3Dblock%26spaceId%3D020f1e0f-2485-4c1e-a522-36307e5e802e%26expirationTimestamp%3D1722139200000%26signature%3DP9tG8N33YejiR-s5nP_pi3ThTYT8NRg9zQDoal-vchQ?table=block&id=7e5b4ed4-292e-4ed1-b907-b7708fe6be74&cache=v2)
- Create a new column called Date to Assemble Calculated Month and Year to get the date of the month:
dateAdd(dateAdd(dateAdd(fromTimestamp(0), 1 - 1, "days"), prop("Calculated Month") - 1, "months"), ((prop("Calculated Month") > month(now())) ? year(now()) : toNumber(prop("Year"))) - 1970, "years")
And Voilà ! You should have a correct date column:
![notion image](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2F020f1e0f-2485-4c1e-a522-36307e5e802e%2F0d2e7500-c786-4ba7-9ec0-c2ee6e77b2ed%2FUntitled.png%3Fid%3D3f50346d-5e20-4b92-a63b-e80e6e4d6b82%26table%3Dblock%26spaceId%3D020f1e0f-2485-4c1e-a522-36307e5e802e%26expirationTimestamp%3D1722139200000%26signature%3DZgEsre95GKlar1TEnaHpQAjruHGXckg4IE3drdW07mc?table=block&id=3f50346d-5e20-4b92-a63b-e80e6e4d6b82&cache=v2)
Now all you have to do is order your chart by Date:
![notion image](https://www.notion.so/image/https%3A%2F%2Ffile.notion.so%2Ff%2Ff%2F020f1e0f-2485-4c1e-a522-36307e5e802e%2F27d38bc3-b97c-4b5d-8946-60964bf9bba2%2FUntitled.png%3Fid%3D17e0d89e-83a7-4293-8a7c-c54761191e1c%26table%3Dblock%26spaceId%3D020f1e0f-2485-4c1e-a522-36307e5e802e%26expirationTimestamp%3D1722139200000%26signature%3DDohrzHDvLhRbCf0oBqeexPCdWTMn9MV1u_2sH-WoyBM?table=block&id=17e0d89e-83a7-4293-8a7c-c54761191e1c&cache=v2)
You can access and duplicate the template with the formula here
Let me know if this article as been helpful on the chat or on our twitter.