Forum Discussion
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?
- Anonymous5 years ago
There different joins kinds, you may try NATURALINNERJOIN in your scenario.
Reference:
NATURALINNERJOIN function (DAX) - DAX | Microsoft DocsNATURALLEFTOUTERJOIN 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.
2 Replies
- amitchandak
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/
- AnonymousNot applicable
There different joins kinds, you may try NATURALINNERJOIN in your scenario.
Reference:
NATURALINNERJOIN function (DAX) - DAX | Microsoft DocsNATURALLEFTOUTERJOIN 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.