Membranes that selectively filter for both anions and cations are central to technological applications from clean energy generation to desalination devices. 2D materials have immense potential as these ion-selective membranes due to their thinness, mechanical strength, and tunable surface chemistry; however, currently, only cation-selective membranes have been reported. Here we demonstrate the controllable cation and anion selectivity of both monolayer graphene and hexagonal boron nitride. In particular, we measure the ionic current through membranes grown by chemical vapor deposition containing well-known defects inherent to scalably produced and wet-transferred 2D materials. We observe a striking change from cation selectivity with monovalent ions to anion selectivity by controlling the concentration of multivalent ions and inducing charge inversion on the 2D membrane. Furthermore, we find good agreement between our experimental data and theoretical predictions from the Goldman-Hodgkin-Katz equation and use this model to extract selectivity ratios. These tunable selective membranes conduct up to 500 anions for each cation and thus show potential for osmotic power generation