Finding a total for Cost where Month is the same as the Month in the current record

In a formula, I want to return the sum of the field Cost where the field Month value matches Month in the current record. Seems like a simple idea but I have not found the formula. I eventually tried this formula:

    ignore(0,cache(Month,lvmonth))+aggregate({Cost},"+",{Month=lvmonth})

This formula crashes Panorama every time in formula workshop. This technique (using ignore and cache with the aggregate function) is suggested on the Help page for the aggregate formula.

Any suggestions would be appreciated.

You do have a syntax error in your cache( function. It should be

cache(Month,"lvmonth")

Thanks Dave. That took care of the crash, but I am still not getting the sum that I want. It just returns zero. Suppose I have this data:

Month Cost
May 100
May 25
April 10

Assuming the first row is the active row, then I would expect the corrected formula to return 125, but it returns zero. The corrected formula is

ignore(0,cache(Month,"lvmonth"))+aggregate({Cost},"+",{Month=lvmonth})

Jim, I suggested an addition to the cache help page saying the variable name must be quoted.

Thanks, I’ll check that out. The general rule is if you are referring to the contents of the field or variable, you don’t quote it, but if you are referring to the entity itself, you usually have to quote it (though there are exceptions, like the let statement, and in some places like lookup( functions it can be either way).