Being able to sort using a date or datetime field in Tableau is a problem I have run into a few times.
The intuitive way you would probably expect for it to work is to right click the dimension you want to sort. Then by field and look for the date field you want to sort by, pick ascending or descending and jobs done. However, for some reason Tableau does not allow you to do that.
There are two ways that I have thought of so far to deal with these problems. The first is to add the data column you want to sort by as the first column. This has lead to some issues with table calculations. I'm sure these can probably be fixed after a lot of fiddling but there is an easier approach.
![](https://www.thedataschool.co.uk/content/images/2023/09/image-208.png)
Using the DATEDIFF function you can calculate how many seconds, minutes, hours, etc. there have been from a point in time compared to today. Then you can use sort the intuitive way and sort using that field.