Forum Discussion
doubts with merge tables
Doubts with merge tables I have this first table with everything, and this second with some occurred, needed based on the id and the fruit return the resutable that has all the occurreds of these fruits of the second table.
first table
| id | fruit | value |
| 1 | grape | 10 |
| 2 | grape | 20 |
| 3 | grape | 30 |
| 4 | apple | 40 |
| 5 | apple | 50 |
| 6 | pineapple | 10 |
| 7 | pineapple | 12 |
second table
| id | fruit | value |
| 1 | grape | 10 |
| 4 | apple | 40 |
Result
| id | fruit | value |
| 1 | grape | 10 |
| 2 | grape | 20 |
| 3 | grape | 30 |
| 4 | apple | 40 |
| 5 | apple | 50 |
Hi felipesaw ,
According to your description, here's my solution.
In the first table, add a custom column.
if List.Contains(#"second table"[fruit],[fruit]) then 1 else 0Then filter the custom column only keep 1.
Result:
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 Replies
- AnonymousNot applicable
If you combine both tables by fruit column, you will have a table like this:
Then if you maintain id and value from table 1 and Fruit from table 2 you have the result
- felipesawFrequent Visitor
Very appreciate, but does not work.
my main connection between the tables is the ID, the name repeats.
I need to use the id column of the second table to search for which fruits you have in the first table that has an id equal to the second. And bring all the lines with this fruit to the result table
- v-yanjiang-msft
Community Support
Hi felipesaw ,
According to your description, here's my solution.
In the first table, add a custom column.
if List.Contains(#"second table"[fruit],[fruit]) then 1 else 0Then filter the custom column only keep 1.
Result:
I attach my sample below for your reference.
Best Regards,
Community Support Team _ kalyjIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.