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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
KatkaS
Post Patron
Post Patron

dax comparison operations do not support comparing values of type integer with values of type text

Dear

 

I get "dax comparison operations do not support comparing values of type integer with values of type text" error for below measure.

Can you please advise why..? both "Application ID" and "Interview" are numbers..

 

# KPI1 B All genders_Nordic2 = CALCULATE(DISTINCTCOUNT('TA_Candidates interview_gender'[Application ID]),FILTER('TA_Candidates interview_gender', 'TA_Candidates interview_gender'[Interviews] = "2"||"3"||"4"||"5"||"6"))

 

Thank you!

2021_09_17_10_22_09_CoE_dashboardV2_Power_BI_Desktop.jpg

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@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}))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

v-yingjl
Community Support
Community Support

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.

View solution in original post

4 REPLIES 4
v-yingjl
Community Support
Community Support

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.

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!

amitchandak
Super User
Super User

@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}))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you! {} works!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.