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
Shree_185
Helper I
Helper I

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

TextTextDecimal NumberText
SeverityCalc Severity Time Spent Customer Reasons
Severity 118.4HW/SW
Severity 222.3Customer awaiting
Severity 335.8 
Severity 446.4 
Severity 553.4 
Severity 663.2 

 

Shree_185_0-1636479536224.png

 

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
AlexisOlson
Super User
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"
)

View solution in original post

1 REPLY 1
AlexisOlson
Super User
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"
)

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!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

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.