There is a wide consensus among Shariah scholars globally that those types of investments which are largely compliant with Shariah but which contain a small proportion of non-compliant income could be permitted. This however requires determination of the threshold of that “minor” portion of non-halal in the investment avenues which could be allowed to the general public due to the unavailability of fully compliant avenues.
Allah Knows Best...