Calculating daily recovery percentage

I’m having trouble with the formula for calculating the daily recovery percentage. I have both shift totals to combine, and the formula needs to calculate the daily recovery percentage. The formula works fine inside the form but gives a zero result after saving the form. The expression I used to calculate the percentage is as follows:

IF(
COUNT(SELECT(MeterReadings[Discharge Quantity (ETP)], [Date] = [_THISROW].[Date])) > 0,
(SUM(SELECT(MeterReadings[Produced Quantity (RO)], [Date] = [_THISROW].[Date])) /
IF(SUM(SELECT(MeterReadings[Discharge Quantity (ETP)], [Date] = [_THISROW].[Date])) = 0, 1, SUM(SELECT(MeterReadings[Discharge Quantity (ETP)], [Date] = [_THISROW].[Date])))) * 100,
0
)