MIP Logo

Grouping Years into Decades in Tableau

This post was originally published on The Data School blog between 2018 and July 2025, before our program was renamed to MIP’s Analytics Career Accelerator. References throughout this article to “The Data School” or “DS” all refer to what is now MIP’s Analytics Career Accelerator. The program, its people, and its commitment to launching outstanding analytics careers remain the same – just under a new name.

If you are having trouble viewing this article, please report it here

To make analysis of time data, especially when the time series data expands many many year, grouping the years into decades will make the analysis a little easier.

Grouping using calculated formula

One way to achieve this grouping would be to use a calculated formula like this:

The formula above, uses the DATEPART() function takes the year then subtracts, the year which has had a modulo applied to it. A modulo function simply return the remainder after a division process. For example, the year 1967, lets apply a modulo operator on it. So, I want to take the 1967%10. As a result this will give us an answer of 7. And when you subtract this from the year it will result in 1960. Finally, the “s” is being added as the resulting calculation will be a string.

Grouping using Groups

Another way of achieving the same result would be to use the ‘Group’ method. To achieve this, click on the desired date field, then choose “create”, then “Group”, like so:

Then in the dialog box as seen below, you can group the desired year into its respective decades.

You have the option to do it 2-ways now. And I’m sure there are other way you can find to do the same task. For now, this will hopefully help.

Share this post