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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Sharma0815
Helper II
Helper II

Using SWITCH function to change the values of column to new values and getting this below error,

SWITCH(Table1[Queue],"CSC EZTech" || "CSC ", Programming Support","Engine","Duty","I6Engine","Medium","Other")
 
I have blanks in Queue column,I'm not sure if blank values causing this error.
 
Error:
Function 'SWITCH' does not support comparing values of type Text with values of type True/False. Consider using the VALUE or FORMAT function to convert one of the values.
1 ACCEPTED SOLUTION

OK, let's figure out what is going on here, try this:

 

SWITCH(TRUE(),
  Table1[Queue] = "CSC EZTech" || Table1[Queue] = "CSC ", "Programming Support",
  Table1[Queue] = "Engine","Duty",
  Table1[Queue] = "I6Engine","Medium",
  "Other"
)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

6 REPLIES 6
Greg_Deckler
Community Champion
Community Champion

Maybe try:

 

SWITCH(Table1[Queue] & "","CSC EZTech" || "CSC ", Programming Support","Engine","Duty","I6Engine","Medium","Other")



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks @Greg_Deckler ,Tried and  still getting the same error 

SWITCH(Table1[Queue] & "","CSC EZTech" || "CSC ", Programming Support","Engine","Duty","I6Engine","Medium","Other")

 

Function 'SWITCH' does not support comparing values of type Text with values of type True/False. Consider using the VALUE or FORMAT function to convert one of the values.

OK, let's figure out what is going on here, try this:

 

SWITCH(TRUE(),
  Table1[Queue] = "CSC EZTech" || Table1[Queue] = "CSC ", "Programming Support",
  Table1[Queue] = "Engine","Duty",
  Table1[Queue] = "I6Engine","Medium",
  "Other"
)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

This one worked for me ,Thanks alot @Greg_Deckler 

 

SWITCH(TRUE(), Table1[Queue] = "CSC EZTech" || Table1[Queue] = "CSC ", "Programming Support", Table1[Queue] = "Engine","Duty", Table1[Queue] = "I6Engine","Medium", "Other" ) 

Cool, OK, so the issue is that SWITCH didn't like specifying a column value to switch on and then coupled with a logical true/false statement. Makes sense.


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Or maybe this:

 

SWITCH(Table1[Queue]
  "CSC EZTech","Programming Support",
  "CSC ","Programming Support",
  "Engine","Duty",
  "I6Engine","Medium",
  "Other"
)


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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