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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
powerbifuddaa
Helper II
Helper II

Function 'CONTAINSROW' does not support comparing values of type Text with values of type True/False

Hi, hope someone can help me out with this DAX problem.

 

When I make this calculated column, it works fine:

@segmentmovement = IF(OR(RELATED('Employment type'[EmploymentType_BK])="t",RELATED('Employment type'[EmploymentType_BK])="v"),
    IF("E02" in SELECTCOLUMNS(FILTER('Contract History', 'Contract History'[Person_BK]=EARLIER('Contract History'[Person_BK])),"1",RELATED('Employment type'[EmploymentType_BK])),1,0),0)
 

However, when I try to add ("E03") in this calculated column, I get an error (Function 'CONTAINSROW' does not support comparing values of type Text with values of type True/False). 

@segmentmovementV2 = IF(OR(RELATED('Employment type'[EmploymentType_BK])="t",RELATED('Employment type'[EmploymentType_BK])="v"),
    IF(OR("E02","E03") in SELECTCOLUMNS(FILTER('Contract History', 'Contract History'[Person_BK]=EARLIER('Contract History'[Person_BK])),"1",RELATED('Employment type'[EmploymentType_BK])),1,0),0)

 

What do I do wrong and what can be the sollution?

Thank you very much. Regards, Elmer

2 ACCEPTED SOLUTIONS
Aibloy
New Member

Hi,
OR is evaluating two expressions and must return TRUE or FALSE for each,
You can try something like that:

 

VAR _ARRAY = 
SELECTCOLUMNS(FILTER('Contract History', 'Contract History'[Person_BK]=EARLIER('Contract History'[Person_BK])),"1",RELATED('Employment type'[EmploymentType_BK]))

VAR CONDITION_1 =
"EO2" IN _ARRAY

VAR CONDITION_2 =
"EO3" IN _ARRAY

RETURN
IF( OR(CONDITION_1,CONDITION2), 1,0)

 

  

View solution in original post

Thanx!
After mixing and trying this worked:

@segmentmovement =
VAR _ARRAY1 = SELECTCOLUMNS(FILTER('Contract History', 'Contract History'[Person_BK]=EARLIER('Contract History'[Person_BK])),"1",RELATED('Employment type'[EmploymentType_BK]))
VAR _Condition_1 = "E02" IN _ARRAY1
VAR _Condition_2 = "E03" IN _ARRAY1
VAR _Condition_3 = "E04" IN _ARRAY1
RETURN
IF(OR(RELATED('Employment type'[EmploymentType_BK])="t",RELATED('Employment type'[EmploymentType_BK])="v"),IF(_Condition_1 || _Condition_2 || _Condition_3,1,0))

View solution in original post

2 REPLIES 2
Aibloy
New Member

Hi,
OR is evaluating two expressions and must return TRUE or FALSE for each,
You can try something like that:

 

VAR _ARRAY = 
SELECTCOLUMNS(FILTER('Contract History', 'Contract History'[Person_BK]=EARLIER('Contract History'[Person_BK])),"1",RELATED('Employment type'[EmploymentType_BK]))

VAR CONDITION_1 =
"EO2" IN _ARRAY

VAR CONDITION_2 =
"EO3" IN _ARRAY

RETURN
IF( OR(CONDITION_1,CONDITION2), 1,0)

 

  

Thanx!
After mixing and trying this worked:

@segmentmovement =
VAR _ARRAY1 = SELECTCOLUMNS(FILTER('Contract History', 'Contract History'[Person_BK]=EARLIER('Contract History'[Person_BK])),"1",RELATED('Employment type'[EmploymentType_BK]))
VAR _Condition_1 = "E02" IN _ARRAY1
VAR _Condition_2 = "E03" IN _ARRAY1
VAR _Condition_3 = "E04" IN _ARRAY1
RETURN
IF(OR(RELATED('Employment type'[EmploymentType_BK])="t",RELATED('Employment type'[EmploymentType_BK])="v"),IF(_Condition_1 || _Condition_2 || _Condition_3,1,0))

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors