Forum Discussion
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 says DAX comparison cant compare Date with Text, the same happen when I use 0 or null.
P.D: Maybe this have been answer before, but I couldn't find it. Sorry in advance
Thank you!!
Try using this Dax:
NewDate = IF ( Table1[Date1] = BLANK (), IF ( Table1[Date2] = BLANK (), Table1[Date3], Table1[Date2] ); Table1[Date1] )
11 Replies
- VvelardeCommunity Champion
- CramosFrequent 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
- harshadshettiwaNew Member
I am facing a problem in the similar lines.
I am trying to evaluate if the date is bank but if function in DAX is not evaluating the date column (that is- the date column is greyed out) is it because I am using DirectQuery???
Is there any work around for this.?
ThanksHarshad
- MAkiva1Helper I
Try creating a new custom column instead of a new measure. You may need to switch from DirectQuery to do this however.