Forum Discussion
Pikachu-Power
Impactful Individual
5 years agoUNION DISTINCT question
hi all, i found following way to combine two distinct tables and use UNION like in SQL (without double entries): TABLE_X = UNION ( SUMMARIZE(Table1, Table1[A], Table1[B], Table1[C]), SUMM...
- Anonymous5 years ago
Hi Pikachu-Power ,
You can write this DAX:
TABLE = Var _X= UNION ( SUMMARIZE(Table1, Table1[A], Table1[B], Table1[C]), SUMMARIZE(Table2, Table2[A], Table2[B], Table2[C]) ) Return SUMMARIZE(_X,[A], [B], [C])Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mahoneypat
Microsoft Employee
5 years agoYou can try this expression
NewTable =
var TableX = UNION (
SUMMARIZE(Table1, Table1[A], Table1[B], Table1[C]),
SUMMARIZE(Table2, Table2[A], Table2[B], Table2[C])
)
Return
SUMMARIZE(TableX, Table1[A], Table1[B], Table1[C])
Pat
Pikachu-Power
Impactful Individual
5 years agoThanks. Seems to work. But shouldnt we use somethink like:
...
Return
SUMMARIZE(TableX, TableX[A], TableX[B], TableX[C])