You need salts.
Sodium and potassium. You can get it from No Salt and pink Himalayan salt. Don’t wait until you’re dizzy to take it. Preemptively consume salts if you’re fasting longer than 24 hours. Or if you’re new to fasting you may need salts even for shorter periods of time.
What hours are you fasting? When I used to work out in the morning, I fasted from 8pm to 12noon. For a while I switched it up and fasted from 2pm to 6am, but I was constantly dizzy at the gym. Listen to your body.