Xander,
I believe I figured everything out. Below is what I basically used to get the 4 items in my popup to work. Although, there's probably a better way to do it. I repeat a lot of the same lines of code in each item that I list in the pop-up. It seems like I'm repeating the same thing 4 times, but I get the correct information and it's fairly quick.
Thanks for your help Xander. Your examples were invaluable.
Travis
//grab meter information from layer "Service".
var meters = FeatureSetByName($map,"Services");
//determine which are within the zone.
var int = Intersects(meters, $feature);
//Master meters have a "1" in the column/field "meter_definition". All other meters are null.
//Use function Filter to isolate master meters within zone.
var master = Filter(int, 'meter_definition >0');
//If more than 1 master meter exists in a Zone, the largest would be the intlet to that Zone. Other's would be outlets/master meters to other zones fed through this particular zone.
var maximum = max(master, "consumption");
//Use varible master to sum consumption of masters meters within the zone.
var MasterTotal = sum(master, "consumption");
//calculate total volume of consumption for ALL OTHER master meters in the Zone
var MasterOut = MasterTotal - maximum;
//calculate consumption of ALL meters contained in the Zone.
var AllMeters = sum(int, "consumption");
//waterloss calculation = maximum - customer consumption - masterout
custconsumption = AllMeters - maximum - MasterOut;
var waterloss = maximum - custconsumption - MasterOut;
Return waterloss;