cancel
Showing results for
Did you mean:

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Helper I

SLA Switch Statements Error - Text and number datatype not supported, use Value or Format

 Text Text Decimal Number Text Severity Calc Severity Time Spent Customer Reasons Severity 1 1 8.4 HW/SW Severity 2 2 2.3 Customer awaiting Severity 3 3 5.8 Severity 4 4 6.4 Severity 5 5 3.4 Severity 6 6 3.2

I want to write 9 - 10 If Else, so thinking to go with Switch. I get error text and number datatype not supported, use value or Format function for one of them

Example If Severity = 2 OR Severity = 3 && Time Spent > 10 , "flag"
If Severity = 3 && Time spent > 4 && Customer Reason!= "HW/SW","Flag","Good"

1 ACCEPTED SOLUTION
Super User

Since severity is a text column, you need to check it accordingly.

Try this as a calculated column:

``````SWITCH (
TRUE (),
Table1[Severity] IN { "2", "3" } && Table1[Time Spent] > 10, "flag",
Table1[Severity] = 3 && Table1[Time spent] > 4 && Table1[Customer Reason] <> "HW/SW", "Flag",
"Good"
)
``````
Super User

Since severity is a text column, you need to check it accordingly.

Try this as a calculated column:

``````SWITCH (
TRUE (),
Table1[Severity] IN { "2", "3" } && Table1[Time Spent] > 10, "flag",
Table1[Severity] = 3 && Table1[Time spent] > 4 && Table1[Customer Reason] <> "HW/SW", "Flag",
"Good"
)
``````

Announcements

New forum boards available in Real-Time Intelligence.

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

Power BI Monthly Update - May 2024

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

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors
Top Kudoed Authors