Forum Discussion
Union Table with different data
- Anonymous8 years ago
Hi Jorgast,
Dax function not support to merge different tables who has different column amounts/name.
You need to select column and modify column name to keep them has same structure, then you can union these modify tables.
Regards,
Xiaoxin Sheng
Hi Jorgast,
I check you table structure and found only two column in these tables can use to compare.(account number and sales agent)
You can use variable to store calculate table with except function with select column function to get distinct records, then merge these to one.
Sample table:
Result =
VAR sale_distint =
CALCULATETABLE (
'Sales',
EXCEPT (
SELECTCOLUMNS (
'Sales',
"Account number", [Account Number],
"Name of Sales agent", [Name of Sales agent]
),
SELECTCOLUMNS (
'Case',
"Account Number", [Account Number],
"Name of Sales agent", [Sales agent]
)
)
)
VAR case_distint =
CALCULATETABLE (
'Case',
EXCEPT (
SELECTCOLUMNS (
'Case',
"Account Number", [Account Number],
"Name of Sales agent", [Sales agent]
),
SELECTCOLUMNS (
'Sales',
"Account Number", [Account Number],
"Name of Sales agent", [Name of Sales agent]
)
)
)
RETURN
UNION (
SELECTCOLUMNS (
sale_distint,
"Account Number", [Account Number],
"Name of Sales agent", [Sales agent]
),
SELECTCOLUMNS (
case_distint,
"Account Number", [Account Number],
"Name of Sales agent", [Sales agent]
)
)
Regards,
Xiaoxin Sheng
- Jorgast8 years agoResolver II
Anonymous
How would i merge the 2 tables together?
- Anonymous8 years agoNot applicable
Hi Jorgast,
Dax function not support to merge different tables who has different column amounts/name.
You need to select column and modify column name to keep them has same structure, then you can union these modify tables.
Regards,
Xiaoxin Sheng