If you’ve ever pulled every active project just to keep the handful that are running low on budget, this one’s for you. Salesforce is piloting FORMULA() inside the SOQL WHERE clause in Summer ’26, and it lets you put the math where the filter is.
Before, you had three bad options when a filter depended on a calculation: add a formula field you don’t really want, copy the rule into Apex and maintain it twice, or pull a big candidate set and throw most of it away in a loop. FORMULA() skips all of that. You write the computed condition once, the platform evaluates it during filtering, and Apex or your API gets back a smaller, already-qualified result.
The shape is simple:
WHERE FORMULA('<expression>') <operator> <literal>The expression runs per row. Right now it supports + and -, and evaluates to DOUBLE, INTEGER, DATETIME, DATE, or CURRENCY. In practice INTEGER acts like DOUBLE and DATE acts like DATETIME, so you really only think about three.
Say you track delivery work in a custom Project__c with Budget__c, Spent__c, StartDate__c, DueDate__c, and Status__c. Here’s the pattern in three real situations.
Find active projects running low on budget, with less than $5,000 left:
SELECT Id, Name, Budget__c, Spent__c
FROM Project__c
WHERE Status__c = 'Active'
AND FORMULA('Budget__c - Spent__c') < 5000Spot long-running projects, where the gap between start and due date is over 90 days:
SELECT Id, Name, StartDate__c, DueDate__c
FROM Project__c
WHERE FORMULA('DueDate__c - StartDate__c') > 90Mix a normal field filter with a computed one to find big projects on a tight timeline, high budget and a short window:
SELECT Id, Name, Budget__c, StartDate__c, DueDate__c FROM Project__c
WHERE Budget__c > 50000 AND FORMULA('DueDate__c - StartDate__c') <= 30