Hi everyone,
I have a somewhat unusual requirement for a Tableau dashboard.
I’m working with a single data source table and I’ve created three KPIs, each based on a different date field (for example Order Date, Sales Date, etc.).
These KPIs are not simple measures: they are calculated as COUNT of records (e.g. IDs) with specific conditions applied, and each KPI is based on a different date field.
The requirement is to:
- Have a single Year filter
- Display the time trend of all three KPIs on the same timeline chart
The challenge is that each KPI uses a different date field.
I would like to avoid heavy restructuring of the data source, since it will be used for self-service BI.
What would be the best approach to handle multiple date fields in a single time series chart in Tableau?
Thanks in advance!
#Tableau Desktop & Web Authoring
#Reports & Dashboards #Analytics
Greetings, @Anna Musella
Create a parameter for the Year filter and build three calculated fields for each KPI that check the year against the parameter, like IF YEAR([Order Date]) = [Year Parameter] THEN [ID] END. For the timeline, create a calculated field like IF [KPI Name] = "Orders" THEN [Order Date] ELSEIF [KPI Name] = "Sales" THEN [Sales Date] END and use this on Columns with your KPIs on Rows. Alternatively, if you can reshape the data with a UNION ALL to create date-bridge rows with [Date Type], [KPI Value], and [Event Date], then build the chart with YEAR([Event Date]) on Columns and [Date Type] on Color.
Best regards