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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
JamesMurg
Helper I
Helper I

DAX code help

Please help, we are trying to create visuals and for some reason our DAX code is showing an error
DAX comparison operations do not support comparing values of type Date with values of type Text. Consider using the VALUE or FORMAT function to convert one of the values.

But we have changed the format of both columns to date, could anyone shed any light on this please?

 

Column = IF('Findings'[Evaluation Date]="",IF('Findings'[Publish +90 days - Evaluation Due Date]>=TODAY(),"Outstanding","Overdue"),IF('Findings'[Publish +90 days - Evaluation Due Date]>='Findings'[Evaluation Date],"On Time","Late")

 

Thanks

James

1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @JamesMurg ,

 

Please try below code:-

Column =
IF (
    'Findings'[Evaluation Date] = BLANK (),
    IF (
        'Findings'[Publish +90 days - Evaluation Due Date] >= TODAY (),
        "Outstanding",
        "Overdue"
    ),
    IF (
        'Findings'[Publish +90 days - Evaluation Due Date] >= 'Findings'[Evaluation Date],
        "On Time",
        "Late"
    )
)

and also change the datatype of column to text.

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

4 REPLIES 4
Samarth_18
Community Champion
Community Champion

Hi @JamesMurg ,

 

Please try below code:-

Column =
IF (
    'Findings'[Evaluation Date] = BLANK (),
    IF (
        'Findings'[Publish +90 days - Evaluation Due Date] >= TODAY (),
        "Outstanding",
        "Overdue"
    ),
    IF (
        'Findings'[Publish +90 days - Evaluation Due Date] >= 'Findings'[Evaluation Date],
        "On Time",
        "Late"
    )
)

and also change the datatype of column to text.

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

You are amazing!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 

Thank you so much 😀

JamesMurg
Helper I
Helper I

Thanks Marek

 

This solution didnt work 😭

 

I am still looking for some help on this solution please?

 

James

marek_zarzycki
Regular Visitor

Hi,

When you're using double quotes "", it's a text. In your first IF, you are comparing date column with text. This is the reason of the error you get.


Try using ISBLANK() or LEN() = 0, depending on what values you are expecting in the column.

IF(ISBLANK('Findings'[Evaluation Date]),IF('Findings'[Publish +90 days - Evaluation Due Date]>=TODAY(),"Outstanding","Overdue"),IF('Findings'[Publish +90 days - Evaluation Due Date]>='Findings'[Evaluation Date],"On Time","Late")

or

IF(LEN('Findings'[Evaluation Date])=0,IF('Findings'[Publish +90 days - Evaluation Due Date]>=TODAY(),"Outstanding","Overdue"),IF('Findings'[Publish +90 days - Evaluation Due Date]>='Findings'[Evaluation Date],"On Time","Late")

Good luck 😉

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.