How To Pivot When You Can’t
Blog | February 15, 2023 | By Hari Ankem
When we work with Excel or text files, we may have often pivoted our dimensions or measures in the data source before proceeding further.
Pivot Date Dimensions:

Result of Pivoted Date Dimensions:

Pivot Measure Values:

Result of Pivoted Measure Values:

But what do you do when you cannot pivot your data columns? You may be able to achieve the same results with joins. (Note: As of release 2022.4, Tableau does not allow joins with published data sources. If you have published data sources and need to pivot, you can achieve it using Tableau Prep.)
Depending on the number of columns you need to pivot, you can create a file with a list of numbers and use it to do a calculated join with your data. For our above scenarios, this is how we would proceed.
File content for pivoting the date dimensions:

Join the data using a calculation as shown below:

File content for pivoting the measure values:

Join the data using a calculation as shown below:

You can now create calculated fields referencing the row numbers to assign the field names and values as desired.
Calculated fields for the date dimensions:


Data displaying the top 25 orders by profit:

Calculated fields for the measure values:


Data displaying the top 25 orders by profit:

Top 25 orders by profit displaying the date dimensions that were pivoted using joins:

Top 25 orders by profit displaying the measure values that were pivoted using joins:
