Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Calculated Column to check same value or not

Hello experts, I wanted to create a calculated column where:   if Column A = Column B, display 1. else 0.   but the issue is, sometimes both column are "Blank", so it will detect as the same, so...
  • Mahesh0016's avatar
    3 years ago

    Anonymous i hope this helps you!THANK YOU!!

    Match =
    VAR A = IF(ISBLANK('Table'[Id]),1,'Table'[Id])
    RETURN
    IF(A=='Table'[Index],1,0)

     

  • ddpl's avatar
    3 years ago

    try this

     

    Column = IF('Table'[ID] == BLANK() || 'Table'[Index] == BLANK() , 0,

                     IF('Table'[ID] = 'Table'[Index] , 1 , 0))
  • mahenkj2's avatar
    3 years ago

    Hi Anonymous 

     

    Please check below:

    Revised =
    IF (
        AND ( ISBLANK ( Tables[Id] ), ISBLANK ( Tables[Index] ) ),
        0,
        IF ( Tables[Id] = Tables[Index], 1, 0 )
    )

     

    Hope it helps.

  • mahenkj2's avatar
    3 years ago

    Hi Anonymous 

     

    Or in your column terms, it would be:

    Revised =
    IF (
        AND ( ISBLANK ( Tables[Column A] ), ISBLANK ( Tables[Column B,] ) ),
        0,
        IF ( Tables[Column A] = Tables[Column B,], 1, 0 )
    )

     

    Hope it helps.