looker-studiodatefilter

Google Data studio -Default filter on last month when data is at month level


I have a report with one data source in Google Data Studio. The data is at month level inside the BigQuery table YYYYMM (for example 202001). I have a filter that is set on the year-month dimension which works ok but I would like to add a default value which changes to last month(max(year_month)) available in the table. Is this possible? I only found the option to hard-code the default selection but this can't be updated dynamically

as in this screen shot

Jaishree's suggestion


Solution

  • You can create an another field/column as same year-month and always keep the latest year-month value as "latest month" or any name you want. You can use logic like

    when existing_column = max(year_month) then "latest month" else existing_column 
    

    Something like this

      existing_column   new_column
      022020            latest month
      012020            012020
      122019            122019
      112019            122019
    

    You can pass this "latest month" value in the default selection option this option which is just below the dimension. But each time you upload new data you have to update this field like change the table suppose for next month you table should be like

      existing_column   new_column
      032020            latest month
      022020            022020
      012020            012020
      122019            122019
      112019            122019
    

    You can make auto update by scheduling queries as well in big query from where you are loading data to Google data studio.