Battery turned into X after Yosemite
There is a circuit board on the battery itself that reports its presence and status to the OS X.

In OS X, there is a piece of hardware run by firmware called System Management Controller (SMC) that takes that information and processes it. Sometimes, the SMC gets confused and needs to be reset following instructions from Apple.

You can also look up your Battery information in the About This Mac, to see what it says.

What could cause the display of the X?

The circuit mounted on the battery itself could have malfunctioned. Normally, it will reserve a minimum charge for itself and not allow the battery to drain beyond that point. But, if the battery was drained to the levels that the built-in circuit can no longer function, it will not report the status and ask to be charged. If you were installing Yosemite, you should have gotten a warning that you are on battery. If ignored, the battery could have been drained completely. 

So what can you do other than SMC reset or bringing it in for repair? You can try the coconut app to see if it does something. https://www.coconut-flavour.com/coconutbattery/