Forum Discussion

J_L's avatar
J_L
Frequent Visitor
3 years ago
Solved

Need help with creating a calculated variance column in Matrix

Hi everyone.

 

Currently I have a dataset which contains the volume of product by date and grade, in rows. I would like to display this in a Matrix and allow the user to slice and dice based on grade of product. The real question/problem I have is, I would like to add a variance column to compare the difference between two rows of data based on date. See my data sample below and my desired Matrix. Ideally, I would like to be able to filter accordingly, and in this case, my default filter is set to 'Export'.

 

 

Raw Data

 

ProductGradeDateVolume
ApplesExport27/10/2022100
OrangesExport27/10/2022120
PearsExport27/10/2022130
BananasExport27/10/202280
ApplesLocal27/10/2022120
OrangesLocal27/10/202240
PearsLocal27/10/202250
BananasLocal27/10/2022100
ApplesExport28/10/2022120
OrangesExport28/10/202240
PearsExport28/10/202250
BananasExport28/10/2022100
ApplesLocal28/10/2022100
OrangesLocal28/10/2022120
PearsLocal28/10/2022130
BananasLocal28/10/202280

 

Desired Matrix 

 

Note: Slicer is set to Export

 

Product27/10/202228/10/2022Volume Diff% Diff
Apples1001202020%
Oranges12040-80-67%
Pears13050-80-62%
Bananas801002025%

 

whereby 

Product is ROWS

Date is Columns

Volume is Values

 

Hope this makes sense and thanks in advance for your help. 

 

Cheers,JL