If you look at purchasing power parity (PPP), the numbers are closer together: $30,859 (Malaysia) and $32,023 (Portugal).
Such economic measures are complex, and if you want to see a single number for a country, that number should be representative for everything and everyone