Train Fare Database Normalisation
You want to convert the pivot table into a normalized table.  Store each cell in your chart as a row in a FARE table.  The business key of this table is Origin + Destination and the non-key columns are Distance and Amount.