Forum Discussion
IF function when Date is empty
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.
- Cramos9 years agoFrequent Visitor
Thanks, you're right, my mistake was that one of the table was store as Text.
- MAkiva18 years agoHelper I
I tried using your DAX to create this and received an error "A single value for column 'Date' in table '[Table]' cannot be determined...
I tried using it as a new Column and as a new Measure. Any suggestions?
- Cramos9 years agoFrequent Visitor
Thanks, it works perfectly!