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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors