Unique cases sum in aggregation

Hello everyone!
I’ve got some trouble with unique case aggregation. I’ve got case table with column “Amount”, and events table with status of process. I want to build table wich consist of some columns from case table, avg timestamp between two activities, and sum (casetable.amount).
So, I build filter on list:
FILTER PROCESS EQUALS ‘(X) Отклонен’ TO ‘(A) Блокирован для платежа’;

And filter’s on component(Table):

FILTER SOURCE(“Celonis_events”.“activity”) LIKE ‘(X) Отклонен’;
FILTER Target(“Celonis_events”.“activity”) LIKE ‘(A) Блокирован для платежа’;

Next, i build table dimensions:

  1. “CELONIS_CASES”.“BUNAME”
  2. “CELONIS_CASES”.“GJAHR”
  3. SOURCE(“CELONIS_EVENTS”.“ACTIVITY”) - not visible
  4. Target(“CELONIS_EVENTS”.“ACTIVITY”) - not visible

AND KPI’S of table:

  1. AVG(TARGET(REMAP_TIMESTAMPS(“CELONIS_EVENTS”.“EVENTTIME”, MINUTES)) - SOURCE(REMAP_TIMESTAMPS(“CELONIS_EVENTS”.“EVENTTIME”, MINUTES)))

2)SUM(“CELONIS_CASES”.“AMOUNT”)

All good, but if within one case we got more than one change status from ‘(X) Отклонен’ TO ‘(A) Блокирован для платежа’ activities - we got (CELONIS_CASES".“AMOUNT”)*(Count of ‘(X) Отклонен’ TO ‘(A) Блокирован для платежа’) and its wrong, because case got fixed amount.

How can i get only unique cases in SUM(“CELONIS_CASES”.“AMOUNT”)? Or better solution?

Thanks!

Best,
Anton