@knshanil, your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advise on) your project
See About the Installation & Troubleshooting category.
- Keep two variables, one for the minimum and one for the maximum. Set maximum to 0 and minimum to e.g. 9999.
- Read the INA219 (no idea how, no experience with it).
- Compare the reading with minimum, update minimum if reading is lower.
- Compare the reading with maximum, update maximum if reading is higher.
- Back to (2).