Forum Discussion

crln-blue's avatar
crln-blue
Post Patron
5 years ago
Solved

Comparing date and string: ISBLANK and FORMAT not working

Hello!

I have an IF statement where I'm checking if my date column is blank. PowerBI does not compare different data types so I tried using ISBLANK function, FORMAT function and VALUE function but I still encounter an error.

 

Error: DAX comparison operations do not support comparing values of type Number with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.

 

My column formula: 

IF('data'[Date1].[Date] < 'data'[Date2].[Date], "Not yet Billed",
     IF('data'[Date3].[Date] = "", "test","test2"     <- error
     )
)
 
Any help is appreciated. Thank you!
  • crln-blue - Use ISBLANK like:

    Column = 
    IF(
        TableName[DateOne] < TableName[DateTwo],
        "Not yet Billed",
        IF(
            ISBLANK(TableName[DateThree]),
            "test",
            "test2"
        )
    )

    using "" is not the same as this is considered to be empty string.

2 Replies

  • ChrisMendoza's avatar
    ChrisMendoza
    Resident Rockstar

    crln-blue - Use ISBLANK like:

    Column = 
    IF(
        TableName[DateOne] < TableName[DateTwo],
        "Not yet Billed",
        IF(
            ISBLANK(TableName[DateThree]),
            "test",
            "test2"
        )
    )

    using "" is not the same as this is considered to be empty string.

    • crln-blue's avatar
      crln-blue
      Post Patron

      Thanks for this! I'll close the thread now.