0
0
Tableaubi_tool~15 mins

Custom date formats in Tableau - Deep Dive

Choose your learning style9 modes available
Overview - Custom date formats
What is it?
Custom date formats in Tableau let you change how dates appear in your reports and dashboards. Instead of using default date styles, you can create your own patterns to show dates exactly how you want. This helps make your data easier to read and understand for your audience. You can format dates to show just the year, month names, weekdays, or even combine parts in unique ways.
Why it matters
Dates are everywhere in business data, but default formats might not fit your story or audience. Custom date formats solve this by letting you tailor date displays to your needs. Without this, reports can look confusing or cluttered, making it harder to spot trends or make decisions. Custom formats improve clarity and professionalism, helping teams trust and act on data faster.
Where it fits
Before learning custom date formats, you should understand basic Tableau date fields and how to add fields to views. After mastering custom formats, you can explore advanced date calculations, dynamic date filters, and time series analysis to deepen your date handling skills.
Mental Model
Core Idea
Custom date formats are like templates that tell Tableau exactly how to show each part of a date, turning raw date data into clear, meaningful text.
Think of it like...
Imagine a calendar where you can peel off the numbers and letters and stick on your own labels—like changing '2024-06-15' to 'June 15, 2024' or 'Sat, 15 Jun'. Custom date formats let you do this digitally for your data.
Date value: 2024-06-15

Format template: "MMMM dd, yyyy"

Output: June 15, 2024

─────────────────────────────
| Date Part | Format Code | Meaning |
|-----------|-------------|---------|
| yyyy      | Year        | 4 digits|
| MM        | Month       | 2 digits|
| MMMM      | Month name  | Full    |
| dd        | Day         | 2 digits|
| d         | Day         | 1 or 2 digits|
| EEE       | Weekday     | Abbreviated|
─────────────────────────────
Build-Up - 7 Steps
1
FoundationUnderstanding Tableau Date Fields
🤔
Concept: Learn what date fields are and how Tableau stores them.
In Tableau, dates are stored as special data types that represent points in time. They include year, month, day, and sometimes time. When you drag a date field into your view, Tableau automatically formats it using a default style like 'MM/DD/YYYY'. These defaults are helpful but limited.
Result
You see dates in your view but only in standard formats like '6/15/2024'.
Understanding that Tableau treats dates as special fields helps you realize why you can change their display without changing the data itself.
2
FoundationDefault Date Formatting in Tableau
🤔
Concept: Explore how Tableau formats dates by default and the options it offers.
Tableau provides several built-in date formats such as 'Month Year', 'Day Month Year', or 'Weekday'. You can select these from the field's context menu. However, these are fixed options and might not fit every reporting need.
Result
Dates appear in one of Tableau's preset styles, like 'Jun 2024' or 'Saturday, June 15, 2024'.
Knowing the limits of default formats motivates learning custom formats to gain full control.
3
IntermediateCreating Custom Date Formats
🤔Before reading on: do you think you can combine month names and day numbers in any order using custom formats? Commit to your answer.
Concept: Learn how to write custom format strings to display dates exactly as you want.
Tableau lets you create custom date formats using format codes inside a string. For example, 'MMMM dd, yyyy' shows full month name, day with two digits, and four-digit year. You enter this string in the Format pane under Dates. Common codes include 'yyyy' for year, 'MM' for month number, 'MMM' for short month name, 'dd' for day, and 'EEE' for weekday abbreviation.
Result
Dates display exactly as specified, like 'June 15, 2024' or 'Sat, 15 Jun 24'.
Understanding format codes unlocks the power to tailor date displays to any style or audience.
4
IntermediateUsing Custom Date Formats in Calculated Fields
🤔Before reading on: can you apply custom date formats inside calculated fields or only in formatting options? Commit your guess.
Concept: Apply custom date formats inside calculated fields using Tableau functions.
You can use the DATEFORMAT function in Tableau calculated fields to convert dates into strings with custom formats. For example, DATEFORMAT([Order Date], 'MMM dd, yyyy') returns a text string like 'Jun 15, 2024'. This is useful when you want to combine formatted dates with other text or use them in labels.
Result
Calculated fields show dates as formatted text, usable anywhere strings are accepted.
Knowing how to format dates inside calculations expands your ability to customize labels and tooltips dynamically.
5
IntermediateHandling Locale and Language in Formats
🤔
Concept: Understand how Tableau handles month and weekday names in different languages.
Tableau respects your workbook locale settings when displaying month and weekday names. So 'MMMM' will show 'June' in English or 'Juin' in French automatically. However, custom formats with hardcoded text won't translate. You can change locale in workbook settings to adapt date displays for different audiences.
Result
Date names appear in the correct language based on locale, improving report relevance.
Recognizing locale effects helps you create reports that feel native to your audience without extra work.
6
AdvancedCombining Dates with Other Text in Formats
🤔Before reading on: do you think you can mix static text and dynamic date parts in one format string? Commit your answer.
Concept: Learn to embed static text with dynamic date parts for richer labels.
In Tableau, you can combine static text with date format codes in calculated fields. For example, 'Sales as of ' + DATEFORMAT([Date], 'MMMM yyyy') creates labels like 'Sales as of June 2024'. This helps make dashboards more informative and user-friendly.
Result
Labels and tooltips show clear, contextual date information combined with explanatory text.
Knowing how to mix text and dates lets you craft messages that guide users through your data story.
7
ExpertPerformance and Limitations of Custom Date Formats
🤔Before reading on: do you think using many custom date formats slows down Tableau dashboards? Commit your guess.
Concept: Understand the impact of custom date formats on performance and their limits.
Custom date formats are powerful but can add overhead if overused, especially in large datasets or complex calculations. Formatting dates as strings disables some date-specific Tableau features like continuous axis or date hierarchies. Also, some format codes are not supported or behave differently depending on Tableau version and data source.
Result
You balance formatting needs with performance and functionality, choosing when to use custom formats carefully.
Knowing these trade-offs helps you design dashboards that are both beautiful and fast, avoiding common pitfalls.
Under the Hood
Tableau stores dates internally as numbers representing days since a base date. When displaying dates, Tableau converts these numbers into readable text using formatting rules. Custom date formats tell Tableau how to map each part of the number to text strings like month names or day numbers. This conversion happens on the fly when rendering views or calculating fields.
Why designed this way?
This design separates data storage from display, allowing Tableau to keep dates precise and flexible. Early BI tools had fixed date formats, limiting user control. Tableau's approach balances performance with customization, letting users tailor visuals without changing underlying data.
┌───────────────┐
│ Raw Date Data │
│ (numeric)     │
└──────┬────────┘
       │
       ▼
┌───────────────────────────┐
│ Format String Interpreter  │
│ (e.g., 'MMMM dd, yyyy')   │
└──────┬────────────────────┘
       │
       ▼
┌───────────────────────────┐
│ Formatted Date Text Output │
│ (e.g., 'June 15, 2024')   │
└───────────────────────────┘
Myth Busters - 4 Common Misconceptions
Quick: Does changing a date's display format in Tableau change the actual date data? Commit yes or no.
Common Belief:Changing the date format changes the underlying date value.
Tap to reveal reality
Reality:Date formatting only changes how the date looks, not the actual stored date value.
Why it matters:If you think formatting changes data, you might mistakenly believe your calculations or filters are affected, leading to confusion.
Quick: Can you use any custom format code from Excel in Tableau? Commit yes or no.
Common Belief:All Excel date format codes work the same in Tableau.
Tap to reveal reality
Reality:Tableau uses its own set of format codes that differ from Excel's; some codes won't work or behave differently.
Why it matters:Assuming Excel codes work can cause errors or unexpected displays, wasting time troubleshooting.
Quick: Does formatting a date as text in Tableau keep it usable for date calculations? Commit yes or no.
Common Belief:Once formatted as text, dates still behave like dates in calculations.
Tap to reveal reality
Reality:Formatted text dates lose date functionality and can't be used in date math or continuous axes.
Why it matters:Misusing formatted text dates can break dashboards or cause wrong analysis results.
Quick: Will Tableau automatically translate custom date formats to different languages? Commit yes or no.
Common Belief:Custom date formats automatically adapt to the workbook locale language.
Tap to reveal reality
Reality:Only built-in date formats respect locale; custom text inside formats does not translate automatically.
Why it matters:Expecting automatic translation can lead to reports with mixed languages, confusing users.
Expert Zone
1
Custom date formats can interact unexpectedly with Tableau's date hierarchies, sometimes disabling drill-down features.
2
Using calculated fields with formatted dates as strings can impact performance on large datasets due to loss of native date optimizations.
3
Locale settings affect month and weekday names but not numeric parts, so mixed locale workbooks require careful formatting choices.
When NOT to use
Avoid custom date formats when you need continuous date axes or want Tableau's automatic date grouping features. Instead, use native date fields and default formats for best performance and interactivity.
Production Patterns
Professionals use custom date formats mainly in labels, tooltips, and titles to improve readability. They combine them with calculated fields for dynamic text and use locale-aware formats for international reports. They also limit custom formatting in large views to maintain dashboard speed.
Connections
Internationalization (i18n)
Custom date formats must respect locale settings, a core part of internationalization.
Understanding locale-aware formatting in Tableau helps grasp how software adapts content for global audiences.
String Formatting in Programming
Custom date formats in Tableau are similar to string format specifiers in languages like Python or JavaScript.
Knowing string formatting concepts from coding clarifies how Tableau replaces format codes with date parts.
Typography and Design
Custom date formats influence how information is visually presented, linking to design principles.
Appreciating design helps you choose date formats that improve clarity and user experience in dashboards.
Common Pitfalls
#1Formatting dates as text and then trying to use them in date filters.
Wrong approach:DATEFORMAT([Order Date], 'MMMM dd, yyyy') used as filter field.
Correct approach:Use original [Order Date] field for filters; use formatted field only for display.
Root cause:Confusing formatted text with actual date data causes loss of filter functionality.
#2Using unsupported format codes copied from Excel in Tableau custom formats.
Wrong approach:Format string: 'dd-mm-yyyy hh:mm:ss AM/PM' (Excel style) in Tableau format pane.
Correct approach:Use Tableau format codes like 'dd-MM-yyyy hh:mm:ss tt' for time and date.
Root cause:Assuming Excel and Tableau share the same format syntax leads to errors.
#3Hardcoding month names in custom formats expecting automatic language translation.
Wrong approach:Format string: 'June dd, yyyy' instead of using 'MMMM dd, yyyy'.
Correct approach:Use 'MMMM dd, yyyy' to let Tableau handle locale-based month names.
Root cause:Not trusting Tableau's locale handling causes static text that won't translate.
Key Takeaways
Custom date formats let you control exactly how dates appear without changing the underlying data.
Tableau uses special format codes to map date parts to text, enabling flexible and clear date displays.
Formatting dates as text disables some date features, so use custom formats wisely depending on your needs.
Locale settings affect how month and weekday names appear, so use built-in codes to support multiple languages.
Understanding the trade-offs of custom date formats helps you build dashboards that are both beautiful and performant.