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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
afkl99
Frequent Visitor

Difference between two text columns

I have two text columns (column A in data table A and column B in data table B -both data tables have id columns). 

 

I want to create a table\matrix in the desktop page that contains an id column, column A, column B and then another column which indicates if A is the same as B.  

 

I would like to avoid doing a query where I merge column A and B based on the id column, but will if there are no other viable options

 

Thank you!

1 ACCEPTED SOLUTION
dilumd
Impactful Individual
Impactful Individual

Since you want a calculated column, use below.

 

A and B = IF(LOOKUPVALUE(TableB[TextA],TableA[TextA],TableB[TextA])=TableB[TextA],"Yes","No")

Help.JPG

View solution in original post

4 REPLIES 4
dilumd
Impactful Individual
Impactful Individual

You can relate table A and B first. Then write a IF function to return "yes" if column A1 = column B1 I don't think you need to merge.

afkl99
Frequent Visitor

Thank you!

 

When trying to implement the following statement: 

 IF( EXACT( 'Table A'[A1]), 'Table B'[B1])), "yes", "no")

 

I get the error: A single value for column 'A1' in table 'Table A' cannot be determined. (for both tables)

 

It is my understanding that I need to add something in the statement so that column A1 and B1 are only compared when the id column in both tables are equal. Is this correct and how would I go about doing this?

dilumd
Impactful Individual
Impactful Individual

Since you want a calculated column, use below.

 

A and B = IF(LOOKUPVALUE(TableB[TextA],TableA[TextA],TableB[TextA])=TableB[TextA],"Yes","No")

Help.JPG

Hi 

 

I get errors when using the same DAX

 

may I know how to edit?

 

Briosjuly77_0-1630053535145.png

 

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.