Trouble getting a list of categories that have entries for a specific category group
I would reverse your logic:


get all entries in whatever channel
display only categories (from a certain group) that have entries fetched in step 1 attached to them


Something along the lines of:

{% set entries = craft.entries.section('myChannel').limit(null) %}
{% set activeCategories = craft.categories.group('myCatgroup').relatedTo(entries).find() %}


You can then use a simple for loop to display only the active categories