Skip to content

TagCustom Summary Formulas

Count the Number of Date Groups in a Report Dynamically

A report request comes in asking for a calculation showing the average number of records created in a week. The time frame for this report could be set to a few different values – like last year, last quarter, or over the course of the previous two years. Ideally, the calculation would be dynamic and count the number of weeks that are present in the report results so that these time frame adjustments can be made on the fly. Using a formula field on the object and a summary formula field within a report, you can dynamically count the number of date groups shown in the report results at run time. Let’s dive into the specifics on both pieces of this solution so you can implement it in your org for your use case.