It works for general questions like 'how many calories are in carrots' or for queries like 'carrots calories'.
By default, Google shows the number of calories in a medium carrot, but you can pick a different serving size: 1 slice, 100 grams, 1 cup grated and more. For now, you can't enter a custom serving size.
You can also disambiguate your query. If you search "tuna calories", you can select from bluefin, skipjack and yellowfin. Unfortunately, the list is incomplete and you can't select canned tuna.
Google shows a knowledge graph card with information from Wikipedia and nutrition facts, so you can quickly find the amount of saturated fat, cholesterol, protein or vitamins and minerals without clicking a search result.
And it's not all about calories. You can also ask: 'how much protein is in an egg?', 'how much cholesterol is in chicken?', 'how much saturated fat is in butter?', 'how much sugar is in Coca Cola?', 'magnesium in an apple', 'vitamin C in parsley'.
The feature only works in English and it's gradually rolling out, so it may not work for you. Try it in Android's Google Search app, Google's app for iOS or in Chrome (click the microphone icon from the search box).