This approach still has limitations, but since Notion hasn't provided a true query language for its database feature, it's the best we can currently do (unless you create an external tool via the official API).
The example database below contains quarterly sales data for a fictional company. The Max property displays the dollar amount from the best quarter, while the Best Quarter property displays which quarter had the best performance.
View and Duplicate Database
College Info Geek on Notion
“Max” Property Formula
max() accepts numbers or number properties.
Here, we simply pass each quarter’s property to the max() function in order to find the maximum quarterly sales value.