Supermetrics Support Forum

How Do I Get the Count of Posts in Data Studio?

There is no default metric for getting the count of posts from Facebook, but you can generate this value with a custom calculated field in Data Studio. Here's step-by-step instructions of how to set this up!

  1. Click the edit icon for the Facebook Insights data source to bring up the field list.

    Blue arrow pointing to the pencil "edit" icon for the data source

  2. Click + ADD A FIELD to bring up the calculated field dialog.
  3. In Field Name, give the calculated field a meaningful name.
  4. In the Formula field, add the following:

    SUM(CASE WHEN Post ID IS NULL THEN 0 ELSE 1 END )


    Example of a completed field configuration:

    Example calculated column that will generate the count of posts

  5. Click SAVE to store the custom field.
  6. You can now add it as a "metric" type field to your report elements!

IMPORTANT - This custom field will behave like a metric, but it's not actually a metric field request to the data source. It is still handled as a "Post ID" dimension by Facebook. So if you use it alone without another metric, you will get the error that "no metric is selected". To get around this, you can use the field with another true metric, add a meaningless filter that uses a metric, or add a field sort on a metric.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.