it appears that this is a multiple row calculation so what you are trying to do is calculate the difference between a min and max value or only on specific dates?
if specifc date then create a formual field to do it for you
if date= firstdate then value else
if date =secondate then value *(-1)
else 0
sum this (likely at a group level to get your value for that group.
You would really need to explain your entire data set more to get more help though.