Count how many customers have ordered 3 or more times in Google Data Studio

Viewed 987

I have a data source added in Google Data Studio which is similar to the following:

Order ID Date Customer ID Total
36252 1/1/2021 12:25:00 6565 $64.00
16805 2/1/2020 13:55:00 694 $32.00
16802 2/1/2020 13:50:00 694 $33.00
16798 2/1/2020 12:13:00 54 $30.00
16790 2/1/2020 10:51:00 1515 $23.00
16784 2/1/2020 10:48:00 386 $34.00
16782 2/1/2020 10:03:00 2968 $30.00
16793 2/1/2020 9:33:00 1197 $124.00
16778 2/1/2020 8:36:00 17 $25.00
16766 2/1/2020 7:48:00 250 $30.00
16760 2/1/2020 5:06:00 2282 $28.00
37176 2/1/2021 14:12:00 6803 $33.00
37175 2/1/2021 13:55:00 4916 $37.00

I need to calculate how many Customers have placed 2 or more orders but haven't found a way to do this.

I tried creating a calculated field with this formula:

CASE
  WHEN COUNT(Customer ID)>1 THEN 1
  ELSE 0
END

but I can't find a way to total this calculated field. I get the error:

Re-aggregating metrics is not supported.

1 Answers

You need to group those data first to be able to count based on Customer ID.

Put Customer ID as dimension and Order ID as metric and you will be able to calculate with your function then show the summary to get the number of customers with order > 2

or if what I wrote here is not what you're expecting and you need to re-agrregate a field, you can use blend data to reaggregate an aggregated field with Customer ID as join key and add Order ID from both table.

Source: https://support.google.com/datastudio/answer/9429470

Related