The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
Solved! Go to Solution.
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
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 😀
Thanks Marek
This solution didnt work 😭
I am still looking for some help on this solution please?
James
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 😉