Hi @Obaid UrRehman ,
Thank you for the ask. As you are joining by ID, that was the expected/correct output you were getting. Main problem here is, the Dataset2 with version does not have any indication which value should be considered for which ID+file. What you can do here:
Note: I have edited the comments: final output would be something like the foloowing:

- for Dataset1, add a
WINDOW





-for Dataset2, add SurrogateKey --> WINDOW


- then do a
JOINwith ID = ID and _ID1 = _ID2

Hope this helps, thanks! :)