Where does the dash fuel economy gauge take it's reading from?

I notice mine is starting to act up (probably because it knows I'm going to by a TT). Sometimes it doesn't work. Sometimes it stays at zero (instead of off the side). Sometimes it just sit at a fixed position.

I notice that when it's 'broken', the OBC readout in test mode and consumption mode is 0 as well.

Any hints?