Not Sure if this will work but in the SQL query, enter the following:
SELECT CASE [datefield] WHEN IS NOT NULL THEN 'Y' ELSE 'N' END as 'Completed'
The null rows is what's causing the course codes to disappear since they have no value.
The statement above brings them to the table with the value of 'N' therefore you should be able to move the created 'Completed' dimension/pill to the TEXT in MARKS card and label what's been completed or not.
Worth a go