I’m skeptical that it would be a problem. Yes it might poke our eyes out to see code that calculates a value 3-4 times and not have it persisted / cached, I get that, I’m just not convinced the virtual attributes are worth the trouble.
Consider this thread: What's the easiest way to populate ecto's virtual field with database data
It has a few ideas that might help you.