Forum Discussion
Combining tables IF
- 7 years ago
PowerBIUser9901 try this
Table_Combine = UNION ( DISTINCT( Table_1 ), DISTINCT( CALCULATETABLE( Table_2, EXCEPT( VALUES( Table_2[Order_Id] ), VALUES( Table_1[Order_Id] ) ) ) ) )
Hi parry2k ,
Take a look at my previous post with the Power BI table created from your DAX formula. Notice that five rows of Order_ID 1200 exist. Table_1 has three occurrences of Order_ID 1200 while Table_2 has two occurreses of Order_ID 1200.
Since the Order_ID exist in both Table_1 and Table_2 the desired output is to only show the three rows of Order_ID 1200 from Table_1. The DAX Formula you suggested UNIONS both tables and shows five rows of Order_ID 1200.
Below is the excel sheet - I color coded it to show how it connects. I Appreciate your assistance.
PowerBIUser9901 now make sense, so red order even if they have different product id and customer id then one in table 1, you still don't want to include since that order already exists in table 1 regardess of different product and order. will get back on this soon.
- parry2k7 years agoSuper User
PowerBIUser9901 try this
Table_Combine = UNION ( DISTINCT( Table_1 ), DISTINCT( CALCULATETABLE( Table_2, EXCEPT( VALUES( Table_2[Order_Id] ), VALUES( Table_1[Order_Id] ) ) ) ) ) - PowerBIUser99017 years agoAdvocate II
parry2k That DAX formula you created does exactly what I was looking for. Thank you very much!