The 'Sum' function calculates the addition of more than one values given in the rows while the 'only' function returns only one value depending on your selection.
And the number of values provided to the function also differs. The Only function accepts one value while the sum function accepts specified set of values to calculate the sum.
In case, if you are providing only one value for both the functions as a parameter, obviously both the functions will give the same result.