I am reading about influence diagrams, and I want to know how their utility function is calculated.
In all of the examples listed in the literature, I am not able to find the formula of the utility function.
You don't find the formula because it's an input.
The "utility" is whatever you are trying to maximize, so you can say that the utility function is part of the definition of the problem you are trying to solve. The utility could represent profit, customer share, fun, number of followers, whatever it is you're trying to maximize. The influence diagram is a tool to help you maximize it.