
1. Re: Percent Difference of Two Fields
Norbert Maijoor Dec 22, 2018 4:38 AM (in response to Antonio Sow)Antonio,
Not sure what you are aiming for. I assume Series A and B are "measures". Is there at least one "Dimension" in your dataset for which both measures Series A & B are available in the dataset? Or please share your workbook in .tbwx format.
Regards,
Norbert

2. Re: Percent Difference of Two Fields
Paul Wachtler Dec 22, 2018 8:41 AM (in response to Antonio Sow)Hi Antonio,
It sounds like you can accomplish this with a simple calculated field. As Series A and Series B are individual measures, this means there is one value for each of these measures for each row in your data (or possibly a null or zero value).
The only thing to be mindful of is that Tableau will return an error if the denominator is zero or null, so we have to code for those conditions. Create a field called [Percent Difference] or whatever else you'd like to call it.
IF [Series B] = 0 OR ISNULL([Series B]) THEN 0
ELSE ([Series A]  [Series B]) / [Series B]
END
Then you can have Series A, Series B, and your Percent Difference fields on your measure values shelf, measure names on columns, and then Percent Difference will calculate across your table.
Best,
Paul