Forum Discussion
dax comparison operations do not support comparing values of type integer with values of type text
- 4 years ago
KatkaS , Try like
# KPI1 B All genders_Nordic2 = CALCULATE(DISTINCTCOUNT('TA_Candidates interview_gender'[Application ID]),FILTER('TA_Candidates interview_gender', 'TA_Candidates interview_gender'[Interviews]
in { "2","3","4","5","6"}))
or
# KPI1 B All genders_Nordic2 = CALCULATE(DISTINCTCOUNT('TA_Candidates interview_gender'[Application ID]),FILTER('TA_Candidates interview_gender', 'TA_Candidates interview_gender'[Interviews]
in { 2,3,4,5,6}))
- 4 years ago
Hi KatkaS ,
Filter(...,[..] = "2" || "3"|| "4"|| "5" || "6") in the formula is not correct. When you use "" to quote numbers, it would be text "2"not number 2 so it return comparsion errors.
In addition, if you want to filter some numbers in a collection {2,3,4,5,6}, just write it directly like Filter(..,[..] in {2,3,4,5,6}) instead of using ||, the formula using || would be like:
Filter(..,[..] = 2 || [..] = 3 || [..] = 4 || [..] = 5 || [..] = 6)
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi KatkaS ,
Filter(...,[..] = "2" || "3"|| "4"|| "5" || "6") in the formula is not correct. When you use "" to quote numbers, it would be text "2"not number 2 so it return comparsion errors.
In addition, if you want to filter some numbers in a collection {2,3,4,5,6}, just write it directly like Filter(..,[..] in {2,3,4,5,6}) instead of using ||, the formula using || would be like:
Filter(..,[..] = 2 || [..] = 3 || [..] = 4 || [..] = 5 || [..] = 6)
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- KatkaS4 years ago
Post Patron
Thank you!
I didn't know that "" are for text only.. (but I actually tried with text, "" and ||, but it didn't work either).
But {} brackets work!