Forum Discussion
Error: The function SUM can not work with values of type String
- 9 years ago
Hi guys,
I found the solution!
I created a new measure, while it should be new column with the same If-formula and now it works =D I'm really happy!!
I do want to emphasize my gratitude for your swift replies, I'm really blown away how many people are willing to help :).
Many thanks and have a great day!
Cheers
Hi dsabsi,
I believe that the question is regarding your column type of data, is your column a number, do you have the E icon on the column?
The expression that you created is ok but if the field is not of the type number it cannot calculate, personnaly I would substitute this by a SWITCH formula that allows a better visualization of you calculations:
SWITCH ( TRUE(), SUM(Table[Colum] = Result1; "Not an Option"; SUM(Table[Colum] = Result2; "Plausible option 2"; "No Way")
Regards,
MFelix
- dsabsi9 years ago
Advocate I
Hello MFelix,
I really appreciate your swift reply!
I tried to use your formula as measure but it gives me the following error: Function 'SWITCH' does not support comparing values of type True/False with values of type Text. Consider using the VALUE or FORMAT function to convert one of these values.
Both columns to which I'm referring are Text (data type and format), so there is no E icon before my columns.
Moreover, I can't change the data type of my measure, do you have any idea how I can show my if-formula in another way or perhaps I'm doing something wrong with your proposed solution :).
Any help is really appreciated!Cheers
- Dog9 years ago
Responsive Resident
Hi dsabsi
agree with Felix, it's quite hard to give the correct solution without knowing some detail about the data types etc... at this stage I'm not sure if you require SUM, if you don't and you are looking at text comparisons then you could try the following. (I'm assuming that you have some form of row level filtering in the visual. (eg. a table which loads the 'TableName'[ColumnName] data)
MyMeasure:=
var Res = IF(ISFILTERED('TableName'[ColumnName]), VALUES('TableName'[ColumnName]))
Return
SWITCH(Res,
"result1", "Not an option",
"result2", "Plausible option 2",
"No Way")