Forum Discussion
Cramos
9 years agoFrequent Visitor
IF function when Date is empty
Hi, I have 3 columns with different dates. I need a function that: IF Column Date1 is empty, take Column Date2, and if this one is empty, take Column Date3. If i use Column(Date1)="", it...
Vvelarde
9 years agoCommunity Champion
- Cramos9 years agoFrequent Visitor
I get "Expressions that yield variant data-type cannot be used to define calculated columns", not sure how to formulate,
IF(ColumnDate=Blank()...?
Thanks
- Vvelarde9 years agoCommunity Champion
Try using this Dax:
NewDate = IF ( Table1[Date1] = BLANK (), IF ( Table1[Date2] = BLANK (), Table1[Date3], Table1[Date2] ); Table1[Date1] )- Anonymous9 years agoNot applicable
That error message means that the formula you wrote would return two different data types. You've done something like
NewColumn = IF(TableName[ColumnName] = BLANK(), FALSE, TableName[DateColumn])
In that example, one condition would return a true/false value and the other would return a date. A single column can't contain both. It has to be either true/false or a date. I have no idea what you've actually written but it's something like that where the two return values are different types. Your two return values both have to be the same data type.