Goal – account for weeks without transactions.
Details –

I am attempting to take Weekly average of each med over 14 weeks (example below).

Sometimes items transactions do not occur in every week (10 weeks in example below).

Taking average is straightforward however accounting weeks without transactions in standard deviation has proved to be challenging.
Problem – I am unable to get the correct SUM for “ADifference” column and subsequently BABS+Square and CSum.
Question – why does it add up to 51.07 and what would be the best way to total it up to 15.7?
here are the formulas used 
WeeklyRETURNED =
CALCULATE(SUMx(‘Transactions',’Transactions'[TransactionQTY]),’Transactions'[TransactionTypes]="Return",ALLEXCEPT(' Transactions',' Transactions'[FacilityNMV2],'Transactions'[DeviceNM],'Transactions'[MedID],'Transactions'[LastTransactionLocalDTS_DateTable  Week]))
WeeklyREMOVED =
CALCULATE(SUMx(‘Transactions',’Transactions'[TransactionQTY]),’Transactions'[TransactionTypes]="Remove",ALLEXCEPT(' Transactions',' Transactions'[FacilityNMV2],'Transactions'[DeviceNM],'Transactions'[MedID],'Transactions'[LastTransactionLocalDTS_DateTable  Week]))
WeeklyRemoveReturned = WeeklyREMOVEDWeeklyRETURNED
WeeksperDataSet = used to account for all 14 weeks in the dataset.
CALCULATE(DISTINCTCOUNT('Transactions'[LastTransactionLocalDTS_DateTable  Week]),'Transactions'[TransactionTypes]="Remove",ALLEXCEPT('Transactions','Transactions'[FacilityNMV2]))
WeeklyAverage = used to account for all 14 weeks to calculate correct weekly average.
CALCULATE([WeeklyRemovedReturned]/[WeeksperDataSet],or('Transactions'[TransactionTypes]="Remove",'Transactions'[TransactionTypes]="Return"),ALLEXCEPT('Transactions','Transactions'[FacilityNMV2],'Transactions'[DeviceNM],'Transactions'[MedID]))
ADifference = to calculate difference for EACH week from average.
[WeeklyRemovedReturned][WeeklyAverage]
BABS+Square =
ABS([ADifference])^2
Csum =
CALCULATE(SUMX('Transactions',[BABS+Square]),ALLEXCEPT('Transactions','Transactions'[FacilityNMV2],'Transactions'[DeviceNM],'Transactions'[MedID]))
hope you can help! Thank you in advance!