By adding the same calculation to ‘Group By‘ clause in SQL query or creating a Calculated Field in the Data Window and using that field whenever you want to group the fields.

Using groups in a calculation. You cannot reference ad-hoc groups in a calculation

Blend data using groups created in the secondary data source: Only calculated groups can be used in data blending if the group was created in the secondary data source.

Use a group in another workbook. You can easily replicate a group in another workbook by copy and pasting a calculation.