If a significant fraction of dark matter is in the form of compact objects, they will cause microlensing effects in the gravitational wave (GW) signals observable by LIGO and Virgo. From the non-observation of microlensing signatures in the binary black hole events from the first two observing runs and the first half of the third observing run, we constrain the fraction of compact dark matter in the mass range $10^2-10^5~{M_odot}$ to be less than $simeq 50-80%$ (details depend on the assumed source population properties and the Bayesian priors). These modest constraints will be significantly improved in the next few years with the expected detection of thousands of binary black hole events, providing a new avenue to probe the nature of dark matter.