Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

DAX, nested if function with not supporting dates and text comparison error

hello there,  I'm trying to add a new column with nested if functions but im getting this error : DAX comparison operations do not support comparing values of type Date with values of type Text. Co...
  • Anonymous's avatar
    Anonymous
    6 years ago

    Hello,

     

    I'm thinking that this part of your switch is where the error could be:

    IF(
    InvestigationCompteur[MT20DateRV]="",
    TRUNC(
    NOW()-InvestigationCompteur[DateIntitiation],0),

    If InvestigationCompteur[MT20DateRV] is a DATE value, you're trying to see if it is equal to "", which is a string value. If you're trying to say, "if [MT20DateRV] is null do this", try setting it = to BLANK() like below:

    IF(
    InvestigationCompteur[MT20DateRV] = BLANK(),
    TRUNC(
    NOW()-InvestigationCompteur[DateIntitiation],0),