Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
crln-blue
Post Patron
Post Patron

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!
1 ACCEPTED SOLUTION
ChrisMendoza
Resident Rockstar
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.

image.png






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



View solution in original post

2 REPLIES 2
ChrisMendoza
Resident Rockstar
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.

image.png






Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

Proud to be a Super User!



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

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.