Hi Jonas!
Could you try a custom sort? I have the feeling that you should be able to sort the data in a way that allows this to happen correctly.
For example, if you add year to the Query but only choose to show periods, can you sort on the year dimension and get the intended result?
Good luck