So, here's a bit of a hack that worked for me, but no guarantees. Although your column (Office in my case) allows you to include multiple values, fill in all your details as needed. After that, go to the "List Options" section, click the "Office" column, and turn off a few values. A warning will appear in SharePoint about how this data could be lost (it never happened to me). Calm down and then change the view you want to group, "Office" should now appear when columns appear for grouping. A completed result will result in your groups (and / or subgroups) being displayed just fine.
The only thing I have is that instead of the element being displayed in both groups AB, because both the field A and the field B were marked in the column field X, it simply creates a new group Column X: A; B. Therefore, in my case, I have staff in the Beaufort and Orangeburg offices, instead of having these employees in both groups (preferred), he creates a new group, as shown below:

source share