Re: How to return a specific value based on the latest date of record
It's better to avoid complicated calculations on the front-end. The output of this script will be able to show the data you need. Just make sure there's no different multiple entries for the same data and the same department.
Then use "only([Product Name])" as a measure for KPI object.