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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
rishari
Frequent Visitor

I need to compare two columns (Not a measure) of different tables.

DAX:

DAX_name = IF( Table1[Column1] = Table2[Column1], [DAX_Measure], 0)

I'm not able to achieve it. I'm new to DAX.

Could anyone help me on this.

2 REPLIES 2
amitchandak
Super User
Super User

@rishari , You can not simply use other tables column

 

If this from one side on the tables

 

DAX_name = IF( Table1[Column1] = related(Table2[Column1]), [DAX_Measure], 0)

 

from many side of the table

 

DAX_name = IF( Table1[Column1] = maxx(relatedtable(Table2),[Column1]), [DAX_Measure], 0)

 

Custom relationship

 

DAX_name = IF( Table1[Column1] = maxx(filter(Table2, Table1[ID] = Table2[ID]),[Column1]), [DAX_Measure], 0)

 

refer 4 ways (related, relatedtable, lookupvalue, sumx/minx/maxx with filter) to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

After IF, I can get only the Measures but not the column names.

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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