Yes, it is possible in Amazon QuickSight,
You'll need to create a calculated field that:
Filters records within your date range
Finds the maximum date within that filtered set
Returns the corresponding string value for that maximum date
Groups by pID and cID
Example with Your Data :
Given your table with:
pID: 5055, cID: 41
mindate: 9/27/2025
maxdate: 9/30/2025
The calculated field will:
Filter records where Date is between 9/27/2025 and 9/30/2025
Find the maximum date in that range (9/30/2025)
Return "StringB" for the row with date 9/30/2025
Return null for all other rows