How To Group Report By Year In Salesforce

In this Salesforce tutorial, we will learn to Group a Report by Year in Salesforce. We will create a custom report in Salesforce Lightning and Salesforce Classic, respectively, and we will group the date fields of these reports in the Year format.

Group a Report By Year In Salesforce

In Salesforce, grouping a report by year involves organizing the data in a report based on the year component of a date field. It is required to group the dates in year format when we have to organize the report data in the yearly or annual format.

By grouping a report by year, we can track the annual performance and analyze the data of the annual activities.

Group a Report By Year In Salesforce Lightning

In this example, I will explain to you the method to group a report by year in Salesforce Lightning.

Here, we will create a custom report for the Opportunities, and later, we will sort or arrange the date field of the data in the yearly format. The data will grouped according to the years 2023 and 2024.

Follow the below step, to create a custom report in Salesforce Lightning.

1. On the Sales application of Salesforce Lightning, click on the Reports tab.

If you are able to find the Reports tab, then click on the App Launcher and search, then select Report to navigate to the Reports page.

2. On the Reports page of Lightning, click on the New Report button.

3. In this step, select the Category as Opportunities, then again select Report type as Opportunites.

After selecting the Category and the report type, click on the Start Report button.

Group report by Year in Salesforce Lightning

4. In this step, we will apply filters to generate records in the report table, and to do that go to the filters tab in the left sidebar and apply the following filters.

  • In the Show Me field, select All Opportunities.
  • In the Date field, select the option Created date
  • In the Range field, select the range as Current and Previous FY to get current and previous year opportunity records.
See also  How to Use IF Filter in Salesforce Report

You can also select the above fields and filters according to your requirements.

Salesforce Group a report in Annual format

5. To add a group row, click on the Outline tab in the left sidebar, then go to the field Group Rows, and there search, then select the date field Created Date.

Now, the date field Created Date will group the dates of records in a row.

Salesforce Lightning Group a report in Year

6. Click on the dropdown of the group row Created Date, and in the options, select Group Date by -> Calendar Year.

Create custom report grouped by Year in Salesforce Lightning

7. On applying the above filter, the data will arranged in the month format as shown in the below picture. Now click on the Save & Run button.

Create Opportunities by year report in Salesforce

8. In this window, enter the below fields to save this report.

  • Enter the name of the report in the field Report Name. In this example, I have named the report as Opportunities created in 2023-24.
  • The field Report Unique Name will be auto-filled according to the entered Report Name.
  • Select the folder to save this report. In this example, I have selected the folder Unfiled Public Reports so that all users can view this report.
  • At last, click on the Save button.
Group Opportunities report by Year in Salesforce Lightning

Now the report will be saved in the folder that you have selected and it will run in the next window where we can view all the records of the report.

Salesforce Lightning Group a report in Year date format

In this way, we successfully grouped a report by year in Salesforce Lighting, where we sorted the report data based on the respective year.

Group a Report By Month In Salesforce Classic

In this example, we will discuss the method by which we can group a salesforce report by year in the Classic edition. In the below steps, we will create a custom report for the Leads, then we will group the date field Created date in the Year format.

See also  How to Restrict Reports Access in Salesforce

After grouping the data in the Year format, the records of the date field Created date will be grouped as 2023, 2024.

To create a custom report in Salesforce Classic follow the below steps.

1. On the Home page of Salesforce Classic, click on the Reports tab.

2. In the Reports & Dashboards window, click on the button New Report to create a report.

Salesforce Group a report in Annual format in Classic

3. In this window, to select the report type, click on the Leads folder and then click on the Create button.

Group report by Year in Salesforce Classic

4. In this step, we need to apply the following filters to generate records in the report table.

  • In the Show field, select the option All Leads.
  • In the Date field, select the option Created date.
  • In the Range fields, select the duration range to display records, and in this example, I have selected the range as All Time.

You can customize the above filters and fields according to your requirements.

Create custom report grouped by Year in Salesforce Classic

5. After applying the filters, we need to change the tabular format to add a group row, and for that, click on the dropdown Tabular format, then select the option Summary.

Group Leads Report by Year in Salesforce

6. In this step, go to the left sidebar, and from there, drag and drop the date field. Create a Date for the region. Drop a field here to create a grouping.

Create custom report grouped by year in Salesforce

7. After adding the date field Created Date as a group row, we will group the dates by calendar month, and for that, click on the dropdown of the group row Create Date. Then, from the option, select Group Dates by -> Calendar year.

Group Dates by Calendar year in Salesforce Report

8. On applying the above filter, the date field Created date will be grouped by the year in which the record was created. Now click on the Save button to save this report.

9. In this window, enter the below fields to save this report.

  • Enter the relevant name for the report in the Report Name field. In this example, I have entered the report name as Anually Created Leads.
  • The Report Unique Name will be auto-filled according to the entered Report Name.
  • In the field Report Folder, select a folder to save the report. In this example, I have saved this report in the Unfiled Public Reports folder.
  • At last, click on the Save and Run Report button.
Group Dates by Calendar year in Salesforce Classic Report

As we click on the button Save and Run Report, the report will be saved in the folder that you have selected, and it will run in the next window where we can view all the records of the report.

Salesforce Classic Report group by Calendar year

Now we can see in the above image the data of the Leads report is groped in the year format CY2024 and CY2023.

See also  How to Create a Donut Dashboard in Salesforce

In this way, we have successfully grouped a Report by year in Salesforce Classic with the help of the above example.

Conclusion

In this Salesforce tutorial, we have learned to Group a Report By Year with the help of the above examples, where we created custom reports in Salesforce Lightning and Salesforce Classic, respectively. In those reports, we have grouped the date field of the data in the Year or annual format.

Along with this, we have also learned about the use of grouping the reports in the year format to organize and sort the records in the report table.

You may like to read: