• is that's what you want?

    SELECT

    count (*)

    FROM

    (SELECT DISTINCT

    PERSONID,

    GENDER

    FROM DATASET)