Forum Discussion
kasiaw29
5 years agoResolver II
Expressions that yield variant data-type error message in if statement
Hi community, I'm tryingto create a custom column that checks some dates and returns "LATE" if it meets criteria or a date otherwise. My formula goes as follows: Actual Start = IF(ISBLANK(...
- 5 years ago
kasiaw29 , One place you are returning "Late" another place date. Power BI dax Do not allow different data types
Try like
Actual Start =
IF(ISBLANK(RELATED('Sub Project w Activities'[Actual Start]))
&& 'Activity History'[Latest Customer Agreed Dispatch Date]<=TODAY(),"LATE",RELATED('Sub Project w Activities'[Actual Start])&"")
amitchandak
5 years agoSuper User
kasiaw29 , One place you are returning "Late" another place date. Power BI dax Do not allow different data types
Try like
Actual Start =
IF(ISBLANK(RELATED('Sub Project w Activities'[Actual Start]))
&& 'Activity History'[Latest Customer Agreed Dispatch Date]<=TODAY(),"LATE",RELATED('Sub Project w Activities'[Actual Start])&"")
kasiaw29
5 years agoResolver II
Thanks amitchandak I've also placed FORMAT in my resultiffalse
IF(ISBLANK(RELATED('Sub Project w Activities'[Actual Start])) && 'Activity History'[Latest Customer Agreed Dispatch Date]<=TODAY(),"LATE",FORMAT(RELATED('Sub Project w Activities'[Actual Start]),""))
Which simingly does the same thing. Thank you so much for your fast reply!