How to Group Records in Power Apps with GroupBy
GroupBy turns a table into one row per value of a column. Each row keeps that value and a nested table of the records that share it. GroupBy(Entries, WeekStart, WeekEntries) gives one row per week, with the week's entries in WeekEntries.
The example is the Overtime Timesheet app, whose My Overtime screen groups each person's overtime into weeks.
Syntax
GroupBy(Table, ColumnName1 [, ColumnName2, ...], GroupColumnName)
- ColumnName(s): the columns to group by. They become columns of the result.
- GroupColumnName: a new column that holds, for each group, a table of the records' other columns.
Column names are written as they are, without quotes. Microsoft's GroupBy reference notes that before Power Apps version 3.24042 they were text in double quotes, and that apps were updated to the new syntax automatically.
Prerequisites
- A column to group by. Often you have to add it first: How to Add a Column to a Table in Power Apps with AddColumns.
- The table in memory, if it comes from SharePoint (see GroupBy and SharePoint).
Step 1: Add the Column to Group By
The example's entries have a date, WorkDate, but not the week. AddColumns adds each entry's Monday, using the app's MondayOf function (How to Find the Monday of a Week in Power Apps):
AddColumns(locLoadedMO, WeekStart, MondayOf(WorkDate))
locLoadedMO is a context variable holding the entries the screen loaded: for November 2026, four entries on 29 October, 1, 2 and 6 November.
Step 2: Group Them
CountRows(GroupBy(AddColumns(locLoadedMO, WeekStart, MondayOf(WorkDate)), WeekStart, WeekEntries))
I put the formula into a text control's Text for a moment, so Studio's preview strip shows the result. CountRows counts the groups: 2 weeks.

Step 3: Look Inside the Groups
Each group has its WeekStart and a WeekEntries table. Concat writes one line per group, and CountRows counts each group's entries (How to Join Table Values into Text in Power Apps with Concat):
Concat(
GroupBy(AddColumns(locLoadedMO, WeekStart, MondayOf(WorkDate)), WeekStart, WeekEntries),
$"{Text(WeekStart, "dd/mm/yyyy")}: {CountRows(WeekEntries)} entries",
"; "
)
The week of 26 October has two entries, 29 October and 1 November, and so does the week of 2 November:

GroupBy and SharePoint
The delegation overview lists GroupBy among the functions that can't be delegated to any data source. On a SharePoint list it would group only the first 500 rows Power Apps fetches.
The example loads the rows it needs with a filter SharePoint can run, keeps them in a context variable, and groups that. A table held by UpdateContext is a static in-memory list, so GroupBy sees all of it: How to Filter a SharePoint List Between Two Dates in Power Apps.
How the Example Uses It
The groups are the weeks of the screen's weekly totals: How to Total Each Group in Power Apps with GroupBy and Sum.
Common Mistakes
| Mistake | What happens | Do this instead |
|---|---|---|
| GroupBy directly on a SharePoint list | Only the first 500 rows are grouped | Group a filtered copy held in a variable |
| Grouping by a date and time column | Every different time is its own group | Group by a column made with AddColumns, such as the week's Monday |
| Quoting the column names, from an older example | That's the syntax from before version 3.24042 | Write the names as they are |
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| One group per record | The grouping column is different on every record | Group by a coarser value: day, week or month |
| The groups aren't in the order you want | Nothing in the formula sorts them | Sort the result by the grouping column |
FAQ
Can I group by two columns?
Yes: list both before the group column, such as GroupBy(Entries, Department, WeekStart, WeekEntries). Each pair of values is one group.
How do I undo a grouping?
Ungroup turns the groups back into records: Ungroup(Grouped, WeekEntries).
Conclusion
GroupBy(Table, Column, GroupColumn) makes one row per value of the column, with the matching records in a nested table. Add the column you need with AddColumns first, and group a table held in memory when the data comes from SharePoint.
Additional Resources
- GroupBy and Ungroup functions: syntax and examples.
- Delegation overview: functions that can't be delegated.
