In last decades frequently use of non-linear loads has caused many power quality problems in power systems. The active power filters are developed to overcome these problems by using some power electronics. This paper presents a three phase shunt active power filter based on three-level neutral point clamped inverter structure. In this study, the novel approach based on to determine the losses occurring inverter throughout a period is proposed. The proposed approach reveals unwanted active current component with fundamental frequency contained in the compensation current which causes oscillation and fall of the DC voltage level of shunt active power filter. The proportional-integral controller that has been widely used by researchers is used to maintain the reference DC voltage level. The proposed system is modeled with MATLAB/Simulink and simulation studies are carried out. The obtained results from the simulation studies show that the proposed approach is uncomplicated, and cheaper than classical PI control algorithm also it is effective as classical PI control algorithm.