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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
paulfink
Post Patron
Post Patron

Merge two tables using DAX

hi guys,

 

need some help with the problem above.

 

I have two tables, table A and table B - A is old data from our old system and B is new data from our new system. They both have the same format and columns.

 

I want to combine these tables so that the all the data is in one single table but it should not add on to extra columns it needs to be add onto each other.

 

However, table A and B are DAX tables using CROSSJOIN with the calendar table so dates are split out.

 

This means i cant use query editor as it is not a query.

 

I have tried:

  • Using UNION and INTERSECT - i get an error saying "column with the name 'Column' already exists" ('Column' changes everytime i try change the formula).
  • Combining using Query Editor first then doing the CROSSJOIN - same error as above.

 

What should i do?

 

 

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@paulfink 

 

There different joins kinds, you may try NATURALINNERJOIN in your scenario. 

 

Reference:
NATURALINNERJOIN function (DAX) - DAX | Microsoft Docs

NATURALLEFTOUTERJOIN function (DAX) - DAX | Microsoft Docs

 


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
V-pazhen-msft
Community Support
Community Support

@paulfink 

 

There different joins kinds, you may try NATURALINNERJOIN in your scenario. 

 

Reference:
NATURALINNERJOIN function (DAX) - DAX | Microsoft Docs

NATURALLEFTOUTERJOIN function (DAX) - DAX | Microsoft Docs

 


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@paulfink , union should work in this case. make sure you column names are the same or use selectcolumns, to rename columns and use them in union

https://docs.microsoft.com/en-us/dax/selectcolumns-function-dax

 

Also refer : https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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