Data item on report page list

Hi I wonder if anyone can help I have an issue trying to do a case statement on a query calculation data item.

My statement is

CASE WHEN CONTAINS ([Make or Buy Code], ‘M’) THEN [MO ID] WHEN CONTAINS ([Make or Buy Code], ‘B’) THEN [PO ID] ELSE ‘N/A’ END

When I try validate the expression I get “fails to load the report specification. QE-DEF-0260 parsing error before or near position: 20 of: “CASE WHEN CONTAINS”

Any help is appreciated