First of all I'm still new to Power bi and Dax so please bear with me on this. Thank you

I want to add a new calculated column called Product Type and this will be based on per location.

On the sample table that I have below

product code aaa123 has 3 records with 3 different movement dates and 3 different locations.

I want to get the most recent movement date for product aaa123, then if the location is NSW then product A, if WA then product B

any suggestions?

| Product Code | Movement Date | To Location |
| --- | --- | --- |
| aaa123 | 12 Nov 2022 | NSW |
| aaa123 | 31 Oct 2022 | ACT |
| aaa123 | 15 Nov 2022 | WA |
| bbb123 | 10 Nov 2022 | NSW |
| bbb123 | 14 Nov 2022 | NSW |
| bbb123 | 01 Nov 2022 | WA |
| ccc123 | 31 Oct 2022 | WA |
| ccc123 | 01 Nov 2022 | VIC |
| ccc123 | 02 Nov 2022 | QLD |
|  |  |  |

I was thinking of using the LASTDATE and IF DAX functions but I don't know how to proceed. Any suggestions?