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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Switch statement comparision datat type error

Hi,

 

I have the following code

 

 

 

Missed Deadlines =
SWITCH (
    TRUE (),
    'Maintenance Ticket System'[Status] = "Critical"
        && 'Maintenance Ticket System'[JobStarted]>1,"Missed",
    'Maintenance Ticket System'[Status] = "High"
       && 'Maintenance Ticket System'[JobStarted]>2,"Missed",
    'Maintenance Ticket System'[Status] = "Medium"
    && 'Maintenance Ticket System'[JobStarted]>3,"Missed",
    'Maintenance Ticket System'[Status] = "Low"
    && 'Maintenance Ticket System'[JobStarted]>5,"Missed"
)

 

 

 

Job Started is a Whole Number and Status is text.

Job Started is a calculated column.

 

The error message I am getting is.....

 

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

 

Any help appreciated.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

The solution was because Job Started had a formula using datediff it seeemd to return text, even though the Job Started column was a whole number .. that didnt throw up an error.. however adding VALUE in front of the date diff on the job started column seemed to resolve the issue.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

The solution was because Job Started had a formula using datediff it seeemd to return text, even though the Job Started column was a whole number .. that didnt throw up an error.. however adding VALUE in front of the date diff on the job started column seemed to resolve the issue.

johnt75
Super User
Super User

Check the types of the columns in Power Query, the issue could be there.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.