Help with SUMIFS Condition Expression Needed

Hi, I need help with an expression please. I am building a fleet management app and need to perform a sumif expression. 

I have two tables a trips table and a stats table as seen below. What I am attempting to sum is the distance travelled per month.

As you can see my sheets formula checks the trips table for the distance travelled and the month in which the trip occurred and then checks if the month is the same in the stats table row and does the calculation. 

I need help as I am not sure how to add this formula as an expression in appsheet. The conditions that have to be met for the calculation to work is what is throwing me.

stats-table-new.png

stats-table-new-2.png

0 1 89
1 REPLY 1

Steve
Platinum 4
Platinum 4
SELECT(
  Trips[Distance Travelled (km)],
  ([_THISROW].[Month & Year] = [End Month & Year])
)
Top Labels in this Space