I have created two 52 week period where the dates roll every time we enter a new week. To sort them I have been using max(week_end) which usually sorted the week correctly. As the weeks roll the end of the current 52 week period becomes the start of the previous 52 week period. The sort used to work but seems to have broken now as week 53 should be the start of the previous 52 week period. Since there was a week 53 in 2020 it means the week numbers wont align exact which is fine, but the order should work. The first graph is correct and how the order worked before I refreshed the data, and the second graph is how it looks now with the order being correct bar week 53 not being at the front. Attached is a list of dates showing how each 52 week period is structured right now.