1. format of the date. max(cloudAgentSnapshotDate) will return numeric value of the date which is being compared to formatted time value, cloudAgentSnapshotDate.
2. Date function with the correct formatting should help. something like - Date(max(cloudAgentSnapshotDate), 'MM/DD/YYYY') - modify the format to your application. if the format is not correct, the sum value will not be what you expect as well.
3. i would set a variable and use it in the set analysis expression. so define a variable vMaxDate as the expression in step 2 and for your sum expression the following: