In their answer, Fizz has already provided the main reason:
Obvious answer: the sanctions don't cover everything.
Still, it's surprising that investments have already reached the level which the had before the sanctions were introduced.
I looked for information on who is investing in Russia. In April German business newspaper HandelsblattHandelsblatt published an article Warum die deutsche Wirtschaft immer mehr Geld in Russland ausgibt, which tries to explain what is driving the investments. Several sectors and large companies are mentioned:
Daimler builds (or has built) a car factory in Moscovia because of Russian pressure (import substitution!). If Daimler wants contracts to supply the public sector with Mercedes-Benz cars, it has to assemble them locally. VW is also investing in Russia.
Wintershall and Uniper, which are active in the oil&gas sector, are mentioned. They are members of the consortium that is building NorthStream2Nord Stream 2, a contentious gas pipeline through the Baltic Sea.
Other companies invest in Russia as labor costs have fallen significantly due to the devaluation of the Russian ruble. For example, the labor costs in the textile industry are no longer higher than in China.
Some companies had been working on projects in Russia that were related to the soccer world cup and want to stay in the market. (Siemens is cited with planning a high-speed rail connection.)
Note: I have omitted the reason Russia is an important market with more than 140 million consumers, as I don't see how this constitutes a change.