Sandro
Sandro

Reputation: 487

Formula to get data from previous month in Google Data Studio

So I'm trying to get the same data (Clicks Jan, Clicks Feb) to display as shown in the picture below. My first guess was to create a new field using the formula feature. Is there anyone that knows what the formula may look like?

The functions list: https://support.google.com/datastudio/table/6379764?hl=en&ref_topic=7570421&authuser=0

enter image description here Using the "New field" feature

Upvotes: 0

Views: 10169

Answers (3)

Kapil Dev
Kapil Dev

Reputation: 21

You can use this formula while creating a column to filter out dates in the last month and create a filter using this column.

CASE
  WHEN "Date column name" < DATETIME_TRUNC(TODAY(), MONTH) AND "Date column name" >= DATETIME_TRUNC(DATETIME_SUB(TODAY(), INTERVAL 1 MONTH), MONTH) THEN 1
  ELSE NULL
END

Upvotes: 2

Bruna Cunha
Bruna Cunha

Reputation: 1

Yes there is a way of doing this with Supermetrics. Watch:

  1. Go to Google Sheets and open the Addon Supermetrics.
  2. Configure the data query as follows:

    • Data source= connect to Google Search Console > Your Property.
    • Select sites > Your property.
    • Select dates > Last Month. (Activate comparison: previous period. Comparison type: absolute).
    • Select metrics: impressions and clicks.
    • Split by: search query.
    • List item
  3. Connect that data source into GDS.

You are done. Table on Google Data Studio

Upvotes: 0

Maureen Liu
Maureen Liu

Reputation: 11

You can't do that in Data Studio and need to make the calculated field in sth like BigQuery. As you say you use Supermetrics plugin I searched Supermetrics for BigQuery and apparently it exists (https://supermetrics.com/blog/supermetrics-for-bigquery) or maybe there is alternative data connector that can import your market data into BigQuery. Once in BigQuery you can do very powerful analytics using SQL. There is built-in connector from BigQuery to Data Studio to visualise your final results.

Upvotes: 0

Related Questions