Here's one approach, using PowerPivot.
First, I'd add a table to define your frequency categories - something like:
Capture.PNG
Format your Visits source data as a table.
Load both tables to the Data Model - I use Power Query (Get & Transform Data) for this.
Now create several DAX Measures in your data model:
Now you can create a pivot table from the data model, using Visits[Clinic] and Visits[Diagnosis] in rows, Categories[Category] in Columns, and [Patients Per Category] in Values.
Capture1.PNG
You can simply refresh all data, to update when your source data changes, or when you make changes to your Frequency Categories.
See attached workbook for worked example - I added a few additional rows to your source data, to demonstrate the calculations.
Bookmarks