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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Helper I

## 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 it will display as 1, not 0.

i want if both blank, display 0.

Really need your help on this.

Thanks in advance.

Zety

4 ACCEPTED SOLUTIONS
Super User

@nurulizzaty i hope this helps you!THANK YOU!!

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

Solution Sage

try this

`Column = IF('Table'[ID] == BLANK() || 'Table'[Index] == BLANK() , 0,                 IF('Table'[ID] = 'Table'[Index] , 1 , 0))`
Solution Sage

Please check below:

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

Hope it helps.

Solution Sage

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.

5 REPLIES 5
Helper I

THANK YOU ALL !! YOU GUYS ARE AWESOME! APPRECIATE IT ! :)))))

Solution Sage

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.

Solution Sage

Please check below:

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

Hope it helps.

Solution Sage

try this

`Column = IF('Table'[ID] == BLANK() || 'Table'[Index] == BLANK() , 0,                 IF('Table'[ID] = 'Table'[Index] , 1 , 0))`
Super User

@nurulizzaty i hope this helps you!THANK YOU!!

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

## Helpful resources

Announcements

#### Fabric certifications survey

Certification feedback opportunity for the community.

#### Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

#### Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors