I have the following query:

```
SELECT    
    D.[Year] AS [Year]
    , D.[Month] AS [Month]
    , CASE
        WHEN f.Dept IN ('XSD') THEN 'Marketing'
        ELSE f.Dept 
    END AS DeptS 
    , COUNT(DISTINCT f.OrderNo) AS CountOrders
FROM Sales.LocalOrders AS l WITH 
INNER JOIN Sales.FiscalOrders AS f 
    ON l.ORDER_NUMBER = f.OrderNo
INNER JOIN Dimensions.Date_Dim AS D 
    ON CAST(D.[Date] AS DATE) = CAST(f.OrderDate AS DATE)
WHERE YEAR(f.OrderDate) = 2019
AND f.Dept IN ('XSD', 'PPM', 'XPP')
GROUP BY 
    D.[Year]
    , D.[Month]
    , f.Dept 
ORDER BY 
    D.[Year] ASC
    , D.[Month] ASC

```

I get the following result the `ORDER BY` isn't giving the right result with Month column as we can see it is not ordered:

```
Year    Month   Depts       CountOrders
2019    1       XSD         200
2019    10      PPM         290
2019    10      XPP         150
2019    2       XSD         200
2019    3       XPP         300

```

The expected output:

```
Year    Month   Depts       CountOrders
2019    1       XSD         200
2019    2       XSD         200
2019    3       XPP         300
2019    10      PPM         290
2019    10      XPP         150

```