diff --git a/apps/portal/src/utils/offers/analysis/analysisGeneration.ts b/apps/portal/src/utils/offers/analysis/analysisGeneration.ts index 956de901..fad35434 100644 --- a/apps/portal/src/utils/offers/analysis/analysisGeneration.ts +++ b/apps/portal/src/utils/offers/analysis/analysisGeneration.ts @@ -199,7 +199,7 @@ const calculatePercentile = ( const salary = getSalary(offer, lastOfferSalary); if (salary !== lastOfferSalary) { - if (salary === offerToCalculateSalary) { + if (salary === offerToCalculateSalary && offerToCalculateIndex === -1) { offerToCalculateIndex = i; } numberOfNoDuplicateOffers++;