You need a variable to find the maximum price date within each p-code. I called mine Var Max Price Date…
=Max([Price Date]) In ([p-code])
That variable works by modifying the default calculation context. I refer to this blog post often on this topic.
And a second variable to determine if a particular row’s Price Date is the maximum. I called mine Is Max Price Date…
=If([Price Date] = [Var Max Price Date]; 1; 0)
I added some extra data to make a more comprehensive example…
You can then add a filter to only show the values where Is Max Price Date = 1.
And you can delete those variable columns from your table if you do not want them there.
That’s it.
P.S. I used this technique to recreate and add to your sample data.