When reporting on performance in Tableau, we often default to standard calendar years for our date logic. But what happens when your organisation reports on tax years instead? In the UK, the tax year runs from 6th April to 5th April of the following year — not something Tableau recognises natively.
In this blog, I’ll walk through how to calculate profit to date in a UK tax year, based on a user-defined date parameter.
Step 1 – Define the Start of the Tax Year
The first step is to determine the starting point of the tax year that your selected date falls within. We’ll assume you have a [Date Selector]
parameter to let users pick a date.
Here’s the calculated field I used to determine the start of the tax year:
IF DATEPART('month', [Date Selector]) > 4
OR (DATEPART('month', [Date Selector]) = 4 AND DATEPART('day', [Date Selector]) >= 6)
// Any dates in the year after April 6th
THEN
// Tax year started this calendar year
MAKEDATE(YEAR([Date Selector]), 4, 6)
ELSE
// Tax year started last calendar year
MAKEDATE(YEAR([Date Selector]) - 1, 4, 6)
END
This logic checks if the selected date falls on or after 6th April. If it does, we build a date for 6th April of the same year. If not, we go back to 6th April of the previous year.
Step 2 – Calculate Profit Since the start of the tax year ( Like a YTD calculation)
With the start of the tax year now defined, we can calculate profit from that point up to the selected date.
Here’s the calculation I used:
IF [Order Date] >= [Start of Tax Year]
AND [Order Date] <= [Date Selector]
THEN [Profit]
END
This returns the profit figure only for dates within the current tax year, up to and including the selected date.
Final Thoughts
This method allows users to flexibly analyse performance across a tax year, using just a couple of calculated fields. It’s particularly useful for organisations that don’t follow the standard calendar when reporting KPIs. I would simply drag the 2nd field into the view to show us the sum of profit up to the date specified in that tax year.