• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Antichaos

Antichaos

Data Visualisation, Tableau & Data Services

  • Home
  • Services
    • Training
    • Portfolio
  • About Johan
  • Blog
  • Contact
  • Nederlands
  • Show Search
Hide Search

blog-en

Year-to-date in Tableau

2017-06-30 by Johan de Groot

If you want to compare last year to this year ‘to date’, you have to take into account that a leap-year adds 1 extra date to the year – so you can’t just compare the day-of-year from this and last year.

Often this filter is used:

DATEPART('dayofyear',[Date]) <= DATEPART('dayofyear',TODAY())

But this is a better one, since this compares day and month:

YEAR([Date]) >= YEAR(TODAY())-1
AND (MONTH([Date]) < MONTH(TODAY())
OR
(MONTH([Date]) == MONTH(TODAY())
AND DAY([Date]) <= DAY(TODAY())))

If you want to have a ‘year to date’ until today (so today excluded), use this one:

YEAR([Date]) >= YEAR(TODAY()-1)-1
AND (MONTH([Date]) < MONTH(TODAY()-1)
OR
(MONTH([Date]) == MONTH(TODAY()-1)
AND DAY([Date]) <= DAY(TODAY()-1)))

Calculate last day of month

2017-06-20 by Johan de Groot

Sometimes you need to calculate how many days a certain month – like the current month. With some nested date-calculations this isn’t that hard to calculate…

[Read more…] about Calculate last day of month
  • « Go to Previous Page
  • Page 1
  • Page 2
  • Page 3

Primary Sidebar

Antichaos Services

  • Need Tableau Help ?
  • Basic, Advanced and Custom Training

Recent Blogposts

  • How to create pill-style navigation in Tableau
  • Tableau Visionary 2026
  • Tableau REST API Connector: Add Live Web Data to Your Dashboards
  • Rounded Corner Maps in Tableau
  • Improving Radar Charts: Showing Overview and Details
  • Create a Radarchart in Tableau – Modular and Simple
  • Radar Charts: Practical tips for when and how to use them
  • Smarter dashboard design – with fewer tooltips
  • Top 2000 in Perspective – Behind the Scenes
  • How to Visualize High-Value Metrics in Tableau Without Starting at Zero

Follow & Connect on

Antichaos

Copyright © 2026 Antichaos

  • Antichaos
  • Privacy
  • Contact