It is not possible to add comments in the definition of the calculated fields of the analysis model, either visual or developed in code.
If the calculation has a certain complexity, reviewing it after some time means taking time to find out why certain decisions were made in the preparation of the calculation.
It would be extremely useful to have the possibility of adding comments in the field calculations, for example in a similar way as they are added in SQL transformations.
Thank you for filing this idea.
Luckily, this is already possible by using "#" in front of your comments.
Hope that helps.
Julian