```python
from typing import List, Dict, Optional

def count_by(records: List[dict], field: str) -> Dict[str, int]:
    if not field.strip():
        raise ValueError("Field name cannot be empty text.")
    
    result = {}
    for record in records:
        if field in record:
            value = record[field]
            result[value] = result.get(value, 0) + 1
    
    return result
```