Electrical valley filtering in transition metal dichalcogenides