Forum Discussion
How to get distinct values when two tables are joined using Union?
Hi,
I Have two tables, where table A has unique values and tables B(dynamically updated) will always contain a few records from table A. Table A
Table B
When I do UNION, I get duplicate rows.
I have also tried using
Anonymous
This is because open High, low values has some diff.
Use Summarize and take min and max of that
Try like
summarize(UNION(VALUES('Table 2'),VALUES('Table 1')),[Date],"Open",max([Open]),"Low",min([Low]),"High",max([High]))
2 Replies
- amitchandak
Super User
Anonymous
This is because open High, low values has some diff.
Use Summarize and take min and max of that
Try like
summarize(UNION(VALUES('Table 2'),VALUES('Table 1')),[Date],"Open",max([Open]),"Low",min([Low]),"High",max([High]))
- MattAllington
Community Champion
UNION in DAX is the same as UNIONALL in SQL. Wrap the whole thing inside DISTINCT()