The right solution would look like:

SELECT TOP 20 source_id, ra, dec, phot_g_mean_mag,
5+5*log10(parallax/1000)+phot_g_mean_mag as absmag
FROM gaiadr1.tgas_source
WHERE parallax > 1
ORDER BY phot_g_mean_mag DESC
Notice, that the WHERE clause is necessary because the log of a negativ number must fail.