MySQL data warehouse calculate difference over years in percentage
Ponder a LEFT JOIN something like this

SELECT  a.year,
        a.month,
        a.total_cost,
        IFNULL(( b.total_cost - a.total_cost ) / a.total_cost ),
                'BASE') AS Diff
    FROM  fact AS b
    LEFT JOIN  fact AS a  ON  a.year  = b.year - 1
                         AND  a.month = b.month
    WHERE  b.year BETWEEN 2009+1 AND 2011+1
      AND  a.year BETWEEN 2009   AND 2011;