If you insert a personalisation, you can use an ‘If-then-Else’ condition.
Furthermore, you can check whether a value is empty, for example:
(If gender = m, then Dear Mr {{lastname}} OR if gender = f, then Dear Mrs {{lastname}} ELSE “Dear Customer”.