Forum Discussion
Anonymous
9 years agoNot applicable
How to use Switch function to change integer to text?
Hi all, I have the following situation: I would like to define number 0 to On Time, 2 to Delayed... but this SWITCH function doesnt support comparing values of type integer with val...
- 9 years ago
Don't put the number in between inverted commas.
i.e.
Column = SWITCH('Fact WaitingroomInsights'[Time],0,"On Time",2,"Delayed",-4,"Earlier than planned",8,"Other")
Note:
1) Only put text in between inverted commas.
2) If this doesn't work, make sure your the Time column's data type is Whole Number by going to Edit Queries.
haozhong
9 years agoResolver I
Don't put the number in between inverted commas.
i.e.
Column = SWITCH('Fact WaitingroomInsights'[Time],0,"On Time",2,"Delayed",-4,"Earlier than planned",8,"Other")
Note:
1) Only put text in between inverted commas.
2) If this doesn't work, make sure your the Time column's data type is Whole Number by going to Edit Queries.