You may want to read the oil viscosity link below to get a better understanding of engine oil.
The executive summary is that BMW requires LL-01 approved oils of 0w-30, 0w-40, 5w-30 or 5w-40 for use in non-M gas engines, for vehicles operated in the U.S.
With multi-viscosity oils the first number represents the cold viscosity rating measured at temps as low as -40 C. The second number represents the hot viscosity rating at 100 C. A 0w oil pumps easier when cold than a 5w oil, which means it can flow to the bearings etc. a little easier than a 5w oil. A 0w-40 and 5w-40 oil have the same hot viscosity rating at 100 C.
Thus the 0w-oil would have a tiny cold start pumping or flow advantage over a 5w oil but both are fully acceptable by BMW. What's most important is that any oil you use is BMW LL-01 approved as this is a warranty requirement in addition to using the proper viscosity.
There are many 5w-30, 5w-40, etc. oils that are NOT BMW LL-01 approved and these should not be used if your vehicle is under warranty as they can void your engine warranty. If you don't care about your engine or warranty you can use whatever oil makes you happy.