Since i don't know your data from Table1, I can't make a test to achieve it.
Please re-upload the picture if my assumption below is not correct.
If table1 and table2 all have "module and group" columns,
You could merge columns for "module and group", then merge two tables based on the merged column in both tables.
Open Home-Edit Queries,
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.