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
MoOnan
Frequent Visitor

Compare columns from two tables side by side

Hi,
I have two tables, which should contain the same values. I try to compare two columns to display missing or different values.
Table 1:

TableNameSQL  ColumnNameSQL
Companies  Name_Id
Companies  Name
Address  Country
Address  City
Address  Street
Address  Company_Id
Sales  Company_Id
Sales  Product
Sales  Value



Table 2:

TableNameLocal  ColumnNameLocal
Companies  Name_Id
Companies  Name
Address  Country
Address  City
Address  Street
Sales  CompanyId
Sales  Product
Sales  Value


The result I try to achieve is a table like the below one:

TableNameLocal  ColumnNameSQL  ColumnNameLocal
Companies  Name_Id  Name_Id
Companies  Name  Name
Address  Country  Country
Address  City  City
Address  Street  Street
Address  Company_Id 
Sales  Company_Id  
Sales    CompanyId
Sales  Product  Product
Sales  Value  Value


I tried various things, including merging these two tables, but I keep getting the below result (multiple values from the second table):

MoOnan_0-1679919777788.png

Can you please help me if it is possible to achieve what I am trying to do?

2 REPLIES 2
amitchandak
Super User
Super User

@MoOnan , Merge the two tables by selecting multiple tables using shift/ctrl

 

https://youtu.be/zNrmbagO0Oo

 

Or create a combine key(column) in both tables, then create a common key table with that key and both columns, join the new table with both tables, and analyze with a column of the common table

 

Power BI- DAX: When I asked you to create common tables: https://youtu.be/a2CrqCA9geM
https://medium.com/@amitchandak/power-bi-when-i-asked-you-to-create-common-tables-a-quick-dax-soluti...

 

Power BI: Power Query Functions one must know
: https://www.youtube.com/watch?v=cN8AO3_vmlY&t=36407s
Power BI - Cheat Sheet: Power Query Functions one must know
https://amitchandak.medium.com/cheat-sheet-power-query-functions-one-must-know-a8531b6e321a

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

Hi @amitchandak
Thank you for the tips, your video about common tables was very informative!
As I mentioned earlier merging wasn't working for me. Also I am not sure what you mean by this: "Or create a combine key(column) in both tables, then create a common key table with that key and both columns, join the new table with both tables, and analyze with a column of the common table"  - I'm sorry, I'm quite a beginner 😞 But I followed the instructions from your video and indeed I was able to get a nice table with comparing columns. However, I still have two issues I wanted to ask you about, can you please help me?

1. First issue: For some reason one value was missing in the result table: CompanyId in ColumnNameLocal. 

MoOnan_0-1680091213658.png

2. Second issue: I had to modify my dataset a little and add two reference tables with TableNames columns. Although I repeated steps from the previous attempt, this time I received this error: 

MoOnan_1-1680091334813.png


These are my tables:

ObjectIdColumnNameSQL
1Name_Id
1Name
2Country
2City
2Street
2Company_Id
3Company_Id
3Product
3Value
4Name

 

ObjectIdTableNameSQL
1Companies
1Companies
2Address
2Address
2Address
3Sales
3Sales
3Sales
3Sales
4Customers

 

FileIdColumnNameLocal
205Name_Id
205Name
301Country
301City
301Street
104CompanyId
104Product
104Value

 

FileIdTableNameLocal
205Companies
301Address
104Sales


And these are the relations:

MoOnan_2-1680091802209.png

 

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