Are you able to re-arrange your data source to read like:
Date | Shipment | Prices | Sales
Where shipment, prices and sales are the values for said date? If not I have done this within tableau by using some custom join calculations and a data source filter.
The same data source renamed and joined:
Join calculation from Prices to Sales:
Join calculation from Prices to Shipment:
And the data source filter applied to the 'Prices' table:
Obviously the above join can be avoided if you can set your data source to the suggested format.
Once you have carried out this step it's a simple matter of writing the formula which is:
This should calculate the weighted average for any time frame that you are interested in. Please see the attached working example:
Sample WA_v10.2.twbx 38.7 KB
Great thanks man,
Would you be able to also tell me how you did the join calculation within Tableau to reformat the structure of the Table?
Thanks a lot,