vertigo-468">Dizziness can have many different causes, and usually a medical evaluation by your
primary care doctor is necessary to get to the bottom of things, especially if the dizziness persists or worsens.
Nevertheless, there are some clues in your story that point more towards certain types of dizziness than others. The fact that the dizziness was strongly related to position (it went away when you changed positions) means that it might be something known as benign postural vertigo (BPPV for short). This is a condition in which small stones get lodged in the position sensing canals inside the inner ear, causing severe dizziness with certain positions.
There are, however, other common causes of dizziness. One of these is an inflammation of the inner ear called labrynthitis, which is usually caused by common viral infections. Certain prescription medications can also cause dizziness, as can dehydration and alcohol consumption. Finally, there are rare but serious causes of dizziness, such as problems with the heart rhythm, that can be ruled out by a doctor.
I suggest making an appointment with your primary care doctor, who can perform a complete examination and help figure out if this needs more workup. They can also prescribe you medication to relieve the dizziness, if necessary.