Forum Discussion

haidong's avatar
haidong
New Member
6 years ago
Solved

DAX comparison operations do not support comparing values of type Text with values of type Integer

I got error message with this fomular :   if('GI_Yield Feb20'[Item_N]="no",'GI_Yield Feb20'[Qty in unit of entry]/2,'GI_Yield Feb20'[Qty in unit of entry]   I have confirmed the data type of[It...
  • V-lianl-msft's avatar
    6 years ago

    Hi haidong ,

     

    I think there may be spaces in the item_n column.

    You can try the DAX below:

    Column =
    IF (
        SEARCH ( "no", 'GI_Yield Feb20'[Item_N], 1, 0 ) > 0,
        'GI_Yield Feb20'[Qty in unit of entry] / 2,
        'GI_Yield Feb20'[Qty in unit of entry]
    )

     

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