formatDate(date, pattern) turns a date into text, for labels such as “May 2026”, keys such as “2026-05” or a sentence built with concat. If all you want is a different look for a date on a chart, change the field’s format instead and keep the date.

Copy and paste

formatDate({Order Date}, 'yyyy-MM-dd')      /* 2026-05-14 */
formatDate({Order Date}, 'dd/MM/yyyy')      /* 14/05/2026 */
formatDate({Order Date}, 'MMM yyyy')        /* May 2026 */
formatDate({Order Date}, 'yyyy-MM')         /* 2026-05, sorts correctly as text */
formatDate({Order Date}, 'EEE dd MMM')      /* Thu 14 May */

Year and quarter label, 2026-Q2:

concat(toString(extract('YYYY', {Order Date})), '-Q', toString(extract('Q', {Order Date})))

Pattern letters

Letters Meaning Example
yyyy year 2026
MM / MMM / MMMM month number / short name / full name 05 / May / May
dd day of the month 14
EEE / EEEE weekday short / full Thu / Thursday
HH / mm / ss hour (0–23) / minutes / seconds 14 / 30 / 00

The patterns follow Joda. They are case-sensitive: MM is the month and mm the minutes. To put a literal letter in the output, such as the T in yyyyMMdd'T'HHmmss, wrap the whole pattern in double quotes or escape the single quotes with a backslash, as the AWS reference shows.

Text sorts like text

The result is a string, so a visual sorts it alphabetically: Apr 2026, Aug 2025, Dec 2025. Patterns that start with the year and use month numbers (yyyy-MM) sort correctly. For anything else, sort the visual by a date field or by truncDate('MM', {Order Date}).

Change the format, not the field

For axes, tables and filters, select the date field in the field well, choose Format and pick or type a date format. The field stays a date: it sorts by time, works with date filters and drill-down, and the period functions keep working. Use formatDate only when you need text: a label inside concat, a key to match another text column, or a dataset column exported to a file.

Checked against the Amazon Quick Sight function reference (October 2026).

References