Skip to main content

I'm having a problem that's taking me a lot of time in Tableau Desktop. I have two databases with the same data, separated only by the year the KPIs were collected. How can I use these two tables together and use the year as a filter? There's a field in both tables for the year the data was collected. For example, 'table_2024' has the 'year' field = '2024', while 'table_2025' has the 'year' field = '2025'.

6 answers
  1. Aug 14, 2025, 6:04 PM

    Hi, @RAFAEL DE ANDRADE​ 

     

    You would need a row union your data.

     

    I may recommend three approaches:

    Tableau Desktop:

    https://help.tableau.com/current/pro/desktop/en-us/union.htm

     

    Tableau Prep:

    https://interworks.com/blog/sparker/2018/05/17/tableau-prep-how-to-union-and-join-your-data-to-infinity-and-beyond/

    https://www.thedataschool.co.uk/sam-search/unions-and-joins-in-tableau-prep

     

    Custom SQL:

    If your data comes from a database, you may work with a DBA to build a custom sql to create a SQL sentence using UNION ALL to union your tables.

     

    If this post resolves the question, would you be so kind to "Select as Best"?. This will help other users find the same answer/resolution and help community keep track of answered questions. Thank you.

     

    Regards,

     

    Diego Martinez

    Tableau Visionary and Forums Ambassador

0/9000