Unknown column in ‘where clause’ when using an alias for a subquery in MySQL

This simple query:

select exam.id as exam_id,
(select count(*) from dataset where dataset.id = exam.id) as n_dataset
from exam
where n_dataset = 0

returns the following error:

ERROR 1054 (42S22) at line 1: Unknown column 'count' in 'where clause'

Why?