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
mmh
Helper I
Helper I

IN & AND Operator

Hi,

I have a measure with IN & AND operator, it has no error, but in visual it giving msg as: 

Calculation error in measure: function Contrainrow doesnot support comparing values of type of Integer with values type of text. Consider the value or format function to convert one of the values:

 

The measures is:

RExp_m = CALCULATE(
[TExp],
ContractExposure[Contract_Type]
IN  {5896,3430,895,1398,200609}
 &&
ContractExposure[Status_Id]
IN {566,2664,100246})
 
NB:Both Column are Integer
Any suggestion appreciated! 
Thank You!
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @mmh ,

I have create a simple sample, please refer to it to see if it helps you.

The [Contract_Type] and [Status_Id] are whole number type.

Then the measure works well.

RExp_m = 
CALCULATE (
    [TExp],
    ContractExposure[Contract_Type]
        IN { 5896, 3430, 895, 1398, 200609 }
        && ContractExposure[Status_Id] IN { 566, 2664, 100246 }
)

vpollymsft_0-1663738069070.png

If it still does not help, please provide some sample data without privacy informtion and desired output with more details.

 

Best Regards

Community Support Team _ Polly

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @mmh ,

I have create a simple sample, please refer to it to see if it helps you.

The [Contract_Type] and [Status_Id] are whole number type.

Then the measure works well.

RExp_m = 
CALCULATE (
    [TExp],
    ContractExposure[Contract_Type]
        IN { 5896, 3430, 895, 1398, 200609 }
        && ContractExposure[Status_Id] IN { 566, 2664, 100246 }
)

vpollymsft_0-1663738069070.png

If it still does not help, please provide some sample data without privacy informtion and desired output with more details.

 

Best Regards

Community Support Team _ Polly

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

tamerj1
Super User
Super User

Hi @mmh 
Please try it this way

RExp_m =
CALCULATE (
    [TExp],
    FILTER (
        ContractExposure,
        ContractExposure[Contract_Type]
            IN { 5896, 3430, 895, 1398, 200609 }
            && ContractExposure[Status_Id] IN { 566, 2664, 100246 }
    )
)

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.