The paper shows that it is possible to design such a switched 1 ‐port which ‐ excited by a sinusoidal voltage ‐draws desired current harmonics. The circuit switched twice within a period can generate odd current harmonics and the circuit switched once within a period generates even harmonics. This new kind of compensator has advantages of active filters such as good compensation characteristics. On the other hand it is easier to realize a large VA compensator based on the presented idea than to realize a high switching frequency static power compensator. Most established active and hybrid filters are based on a load current measurement. The compensator presented in the paper can be used to eliminate current distortion as well as voltage distortion. The two‐step optimization with the use of the harmonic voltage measurement allows to eliminate harmonic voltage. The results of numerical simulation and experimental results are presented.