BMW Questions? Ask a BMW Repair Expert for Answers.
It looks like Steve is not available right now, but I hope I can help. This model has experienced some issues with vacuum leaks at the intake that can cause your symptoms. It is also possible your throttle plate is simply gummed up and needs to be cleaned (the fly by wire system can't maintain good idle if the throttle gets sticky, and this will cause a check engine light). Really the best course of action is to get the computer(s) scanned for codes. The stored code will point towards a diagnosis.