How do we calculate a team-level NPS score from individual ticket-level NPS ratings in INSIGHTS

We need to calculate and display the following requirement in INSIGHTS:

We currently store an individual NPS score only (0–10 rating) for each support request/ticket in the data object. For our dashboard, we need to roll these individual scores up into a single team NPS score, following the standard NPS methodology of classifying each ticket as a Promoter, Passive, or Detractor, and then computing:

NPS=Promoters−Detractors

Could you help outline the correct calculation logic (and any edge cases, such as handling missing/null scores) so we can implement this consistently across the “NPS For Team” gauge using Insights?

Thanks,
Nanthitha.