Forum Discussion
Previous rather than MINX
- 5 years ago
Here is a column expression that does that. Note that in your example pbix, I had to change the data type of the Total In column to number.
Diff From Prev =
VAR thissale = Theory[Total IN]
VAR thisdate = Theory[Date Offer Accepted]
VAR prevdate =
CALCULATE (
MAX ( Theory[Date Offer Accepted] ),
ALLEXCEPT (
Theory,
Theory[Property Name]
),
Theory[Date Offer Accepted] < thisdate
)
VAR prevsale =
CALCULATE (
SUM ( Theory[Total IN] ),
ALLEXCEPT (
Theory,
Theory[Property Name]
),
Theory[Date Offer Accepted] = prevdate
)
RETURN
IF (
ISBLANK ( prevsale ),
BLANK (),
thissale - prevsale
)Regards,
Pat
Thank you very much, that worked for me mahoneypat
Thank you too Anonymous for helping me also, much appreciated