Note: All number values in the same column must have the same number formatting. Pivoting measures may cause issues creating additional views. If using this method, consider making a data source just for this view.
PIVOT ALL OF THE DESIRED MEASURES
For some data sources, it is possible to pivot the data in Tableau Desktop. For directions, please see
Quick Start: Pivot Data from Columns to Rows. For all other data sources, it will be necessary to pivot the data in the data source itself.
CREATE A CALCULATED FIELD FOR EACH COLUMN IN THE FINAL VIEW
Select Analysis > Create Calculated Field
- In the Calculated Field dialog box that opens, do the following, and then click OK:
- Create a calculated field with a name like "2015 Values" with a calculation similar to the following:
IF YEAR([Order Date]) = 2015 THEN [Pivot Field Values] END
- Create a calculated field with a name like "Difference" with a calculation similar to the following:
SUM([2015 Values ]) - SUM([2014 Values])
- Create a calculated field with a name like "% Difference" with a calculation similar to the following:
( SUM([2015 Values ]) - SUM([2014 Values]) ) / SUM([2015 Values ])
BUILD THE VIEW
-
Drag [Pivot Field Names] onto the Rows shelf.
-
Drag [2014 Values] to Text on the Marks card.
-
Double-click each calculated field to add them to the view.
-
Right-click "Pivot Field Names" in the view and select Hide Field Labels for Rows.