Forum Discussion
amit_wairkar
2 years agoFrequent Visitor
Error in formula
Hi All,
I have written a formula
Deviation Closure slippage = IF(ISBLANK('Tracker '[Deviations Closed on]),DATEDIFF(TODAY(),'Tracker'[Actual Finish],DAY),"Complete")
It is giving me the following error: Expressions that yield variant data-type cannot be used to define calculated columns.
Kindly guide.
Regards,
Amit
1 Reply
- danextianSuper User
Hi amit_wairkar,
DATEDIFF ( TODAY (), 'Tracker'[Actual Finish], DAY ) returns a number while "Complete" is a text string thus the error. You can use FORMAT to convert the second argument of IF to into text string - FORMAT ( DATEDIFF ( TODAY (), 'Tracker'[Actual Finish], DAY ), "0" )