Nowadays, the proliferation of distributed energy resources has the potential to overcome the majority of the environmental challenges associated with energy generation from non-renewable resources. Nonetheless, their generation capacity fluctuates constantly in response to the amount of energy received in peripheral conditions. To address this issue, maximum power point tracking (MPPT) algorithms must be used. There are several MPPT approaches; the majority of them either lack tracking accuracy at the maximum power point (MPP) or perform poorly, posing a fundamental challenge as steady-state response fluctuations. The purpose of this paper is to eliminate the shortcomings of conventional methods by introducing a data-driven control approach. The conventional MPPT methods are based on the system's model, and it is critical to consider an accurate model for the desired system. This paper proposes a data-driven method known as iterative feedback tuner (IFT) for achieving the MPP of a photovoltaic (PV) system using a PI controller. The proposed control approach is validated through simulation studies.