Create charts with date and time data
Data Studio gives you a number of tools for working with date and time-based information. Most chart types can be broken down by a date dimension. You can set default date ranges for your reports, and you can include a customizable calendar widget so viewers can control the timeframe.In this article:
Dates in reports, data sources, and your data set
The following are keys to understanding how to work with date-based data in Data Studio:
- Date data comes from your data set. Data Studio has no way of applying date ranges to your reports on its own.
- Date data needs to be in a format Data Studio can understand. See How Data Studio handles dates.
- The date and time units available for visualization depend on the date dimensions in your data source. For example, in order to show sales by calendar quarter, you'll want to have a "Quarter" or "Year Quarter" dimension in the data source. See Date types.
- You control the timeframe of your charts by editing the date range properties in your reports. You can use a date range control to let your viewers control the timeframe of the report.
Set the Date Range Dimension
The Date Range Dimension is the dimension that contains your date data. This is the dimension Data Studio will use to constrain the timeframe of a chart, control, page, or report.
Google Analytics components automatically use the
ga:date dimension as the Date Range Dimension. For other data source types, Data Studio does its best to determine the dimension to use. You'll only need to set this manually when Data Studio cannot find a valid date dimension, or if your data source contains a different dimension you want to use.
- Select the chart
- Select the DATA tab
- In the Data Source section, click the Date Range Dimension chip, then use the dimension picker to select a valid time dimension
The Date Range Dimension can also be set at the report or page level using the File > Report settings menu or the Page > Current page settings menu.
Visualize date-based data
The simplest way to visualize date-based data is to use a time series chart. A time series plots your data using the selected date dimension as the X-axis, letting you see how that data changes over time. You can also use bar charts, area charts, and scatter charts to visualize date dimensions.
See the chart reference.
Compare to previous period
Some charts, such as the time series, scorecard, and table, can compares one date range to another. You can compare the current range to the previous matching period (e.g., compare this week to last week), or to the current date range in the previous year (e.g., a calendar week this year to the same calendar week last year). Data Studio automatically colors positive and negative changes. You can set these colors using the STYLE tab for the selected chart.
Change the default date range
The default date range for your charts and controls depends on their data source. For example, charts based on Google Analytics data show the last 28 days' worth of data by default. Charts based on Google Sheets show all the data in the sheet. You can change the amount of data shown by setting the Default Date Range property. You can set this property for your entire report, specific page, or for one or more charts and controls on a page.
To change the default date range for the entire report, edit that report and select the File > Report settings menu
To change the default date range for a specific page, edit that page and select the Page > Current page settings menu
To change the default date range for a single chart or control, select it
To change the default date range for a group of charts, select them
- In the Properties panel on the right, select the DATA tab
- Scroll down to find the Default Date Range property
- Select Custom
- Click the currently selected range to display the date range options
Date range options
You can use the calendar widget to define either a fixed date range, or a rolling date window.
Fixed date ranges let you set beginning and ending dates. Your chart will always show that specific time frame.
To set a rolling date window, select one of the predefined options, such as "Last week" or "Last month." Rolling date ranges are relative to "today."
Let viewers change the date
You can enable your viewers to adjust the date range by placing a date range control on the report.