According to recent power quality (PQ) studies, voltage sags and voltage unbalance in medium voltage and low voltage distribution grids are the most common type of power quality problems. This paper presents a solution to two different types of power quality issues; voltage sag and voltage unbalance. In order to study the actual impact of these two PQ issues, a study case based on real nonlinear loads data consists of large induction motors, located at Beshai Company in Sadat city, are investigate, the dynamic voltage restorer (DVR) is proposed to eliminate the voltage unbalance and the voltage sag problems. The dynamic voltage restorer is linked to the PCC to improve the PQ issues that have been identified. Matlab Simulink platform is used to simulate the power network, loads, and the dynamic voltage restorer (DVR). The jellyfish search optimizer (JFS) is utilized to get the gain values of the PI controller for the proposed DVR. The results of Matlab/Simulink advocate the proposed device's effectiveness, robustness, and latency.