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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
tmacfrank
Frequent Visitor

Merge columns from two tables

Hi,

 

I have two tables A & B.

 

Table A contains 4 columns: "CID", "Primary tag", "Age" & "Sales"

Table B contains 4 columns: "CID", "Digital tag",  "Age"  & "Sales"

 

Two tables share common column CID, each CID is unique. The only difference of two tables is that A contains "Primary tag" but B contains "Digital tag"

 

I want a new table, Table C,

Table C contains 5 columns: "CID", "Primary tag",  "Digital tag", "Age" & "Sales".

 

in other words, I am trying to append "Digital tag" to Table A, or "Primary tag" to table B. 

 

"Merge" under Query editor is not working as each table has over 4 million rows, any  DAX codes I can apply to deliver that?

 

Thanks in advance !!

 

 

 

 

1 REPLY 1
v-yuta-msft
Community Support
Community Support

Hi tmacfrank,

 

Are the values in column CID same in the two tables? Do they have a relationship with each other like one-many, one-one or many-one? If they have, suppose Table A is on the "one" side, you may create a calculate table using DAX like pattern below:

Merged Table =
SUMMARIZE (
    'Merged Table',
    'Table A'[column CID],
    "Primary tag", 'Table A'[Primary tag],
    "Digital tag", RELATED ( 'Table B'[Digital tag] ),
    "Age", 'Table A'[Primary tag],
    "Sales", 'Table A'[Sales]
)

Regards,

Jimmy Tao

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.