Please find attached an example of what I think you're looking for. The selection of the master city is a bit naive, but hopefully you can adapt it to suit your model. 'Last' is a chart inter record function, so your master city would always need to be last in sequence for this to work.
Hope it helps
Pivot - Relative Values.qvw 135.5 K