You're trying to do one of those things that seem like they should be simple but they're not. First I suggest reshaping your data. Depending on your version of Tableau this is possible to do in Tableau.
Edit your data source and select the 3 Value X columns and Pivot these
From there it's simple to produce your initial table:
However the YoY calc as one column is more complex. Tableau will create your Percent Difference calculation for you doing a Quick Table Calculation. Adding this gets you part way to where you want to be:
Creating a flat table with 3 headers, 2015, 2016 and YoY is more complex and will require creating calculated fields.
Create a field called 2015 with this formula: if [Year] = '2015' then [Pivot field values] END
Do the same for 2016. Use these fields to create the Yoy calc SUM()/SUM() - 1. Then you can put it together and get the following:
Thank you so much for your quick answer. However, I forgot to mention that I want to do this without reshaping my data as i need the varibles for some other calculations.
Your anwer was totally correct given my explanation, but do you by any chance know how to do the exact same thing without reshaping the data?
You could reshape and then recreate your fields Value A, B & C. This formula would recreate Value A:
IF [Pivot field names] = 'Value A' THEN [Pivot field values] END