Forum Discussion
Error - Switch function does not support comparing values of type Text with values of type Integer.
Can anyone help with above error message in below code:
You are telling switch to check for 1 in the [Category] column. There is no 1 in the [Category] column. You either need to have switch look for "Platform Inflow" in the [Category] column or look for 1 in the [CategorySort] column.
6 Replies
- jdbuchanan71Super User
My guess is your problem is here.
SELECTEDVALUE ( 'Inflow Category'[Category] ), 1,What are the values in the 'Inflow Category'[Category] column becuase the measure is checking if is = 1
If it is 1 maybe it is stored a text in the model? try it with SELECTEDVALUE ( 'Inflow Category'[Category] ), "1",
- GraceTCLHelper II
Hi jdbuchanan71 Thanks for your reply!
Unfortunately it still doesnt work after I tried with 'SELECTEDVALUE ( 'Inflow Category'[Category] ), "1",".
The values in my table are in the screenshot.
Could it be because I return no values for some of my divide functions as numerator or denominator may be zero? If so, how do I correct that?
If this is not the reason, pls still advise. Thanks!
- jdbuchanan71Super User
Can you share what your 'Inflow Category'[Category] table looks like? Your switch is saying look for a 1 in the [Category] column. What are the values in the [Category] column?
- jdbuchanan71Super User
Is Category[CategorySort] a number or text, in your formula you are checking it one way first then the other way.