Forum Discussion

novicepowerbi's avatar
novicepowerbi
New Member
2 years ago
Solved

Copy paste specific rows from one table to another table based on matching value

Hi, 

 

I am very new to this. 

 

  • I have 2 tables: 'Summary Table' and 'Details Table'
  • There are cells from 'Details Table'[ACTIVITY ID] that match in 'Summary Table'[SUMMARY ACTIVITY CODE]
  • I want to copy-paste the complete rows that have matching cells from 'Details Table' to 'Summary Table', but also insert the copied rows under the respective match.

Sample arbitrary data:

 

Desired outcome:

I am able to combine the two tables with only the rows with the matching cells but i cant insert them where I want to be automatically.

 

 

 

  • Hi novicepowerbi 
    You can get the desired result by those steps :
    1. merge details with summary table, by activity id :

    after this step, you will have just needed rows from the details table, so you can delete the newly created column

    next step is just to append the tables

    result:

    Note that you cant delete unnecessary table because of merge , so you can just not to load it to the model

    Pbix is attached

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

  • Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

3 Replies

  • Hi novicepowerbi 
    You can get the desired result by those steps :
    1. merge details with summary table, by activity id :

    after this step, you will have just needed rows from the details table, so you can delete the newly created column

    next step is just to append the tables

    result:

    Note that you cant delete unnecessary table because of merge , so you can just not to load it to the model

    Pbix is attached

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

  • Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.