How to work with date in Data Studio?

By Zekeriya Mulbay

You can use functions in calculated fields to create new columns of date and time data in your data source or directly in components on the report.

Where to use them?

For example, you can construct a complete date from separate numeric day, month, and year fields using the DATE function. Or you can extract date and time parts from a date with functions like YEAR, DAY, and HOUR. You can even calculate the difference between 2 dates using DATETIME_DIFF, or add a certain number of time parts using DATETIME_ADD.

Date and Date & Time literals

To use literal date and time values in a calculated field, you can precede the value with the appropriate marker:

Examples:

Calculate the difference between a date from data and a specific fixed date:


You can find all calculated field functions here:

Spread the word

Keep reading