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

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)