Calculated field error for repurchased

I am new to quicksight and want to calculate number of repurchasing guests in menu_item_name that is count of distinct account_id who purchased the menu_item_name more than 1.
the below formula is giving me wrong result:

ifelse(countOver({account_id}, [{account_id},{menu_item_name}], PRE_AGG) > 1, 1, NULL)

Hi @dna
What if you start to check thebl countOver part in a separate calculated field and see what the numbers are?

I did not get it. Would you please elaborate?

Can you create a calculated field with just

countOver({account_id}, [{account_id},{menu_item_name}], PRE_AGG)

to see if that calculation is right. So you can see if e.g. the partition is set right.

Hi @dna - can you try this (assuming you have some column that is unique for each purchase, which Im referring to as ‘order id’ here):

ifelse(distinct_count({order id}, [customer, product])>1, 1, 0)

Then Sum that when you add it to your visual.