Classical discontinuous pulsewidth modulations (DPWMs) may not be efficiently applied in active power filters (APFs), because it is hard to predict the peak values of the inverter current, and consequently it is difficult to calculate the position of the clamped interval, that minimizes the switching losses in any operating point. This paper proposes a new DPWM strategy applied to shunt APFs. The proposed modulation strategy detects the current vector position relative to the inverter voltage reference and determines instantaneously the optimum clamped duration on each phase. It achieves a clamped voltage pattern, with variable lengths depending on the magnitude of the inverter current. This property adaptively reduces the current stress and minimizes the inverter switching losses, regardless of its application. The proposed modulation strategy is described, analyzed and validated on a three-phase voltage source inverter, rated at 7 kVA 400 V, controlled as an APF.