If you want to get an original equipment BMW speedometer, (or other cable driven speedometer), you need to look at the ratio which is stamped into the topside of the final drive (near where the swingarm driveshaft housing bolts on to it). There will be numbers like "31/9" or "32/9", etc. Assuming that you still have an 18" rear wheel fitted, that will tell you which ratio OEM speedometer you need - go to this web link, scroll down a bit to the table which shows the ratios, and match the ratio you found stamped into your final drive under the "teeth" column. follow that row across to the column marked "speedo ratio, MPH" and that box has a number, such as "1.259" for example, which goes with the 31/9 teeth example. The proper BMW factory speedometer ratio for you would then have a "W1259" marked on the bottom of the face of the speedometer dial. The number represents the number of revolutions per mile, so 1,259 revolutions of the big gear in that final drive, assuming an 18" wheel attached is 1 mile.
http://bmwmotorcycletech.info/ringgears.htmYou can get non-working BMW speedometers repaired, or ones with the incorrect ratio recalibrated to what you need, but you'll be looking at around ~$250 to do this after you have the speedometer in hand.
If you get some other brand of cable driven speedometer, you can still use the numbers above to identify how many revolutions per mile it must be calibrated for.
Or you can go digital, using magnetic pickup on the front wheel like many folks with customized bikes do. This is generally much cheaper/easier to do, unless you want the old school look. A number of people here have used the Vapor model on their bikes, including Monte Miller-