A couple possibilities:
You can put the X variable in Group X and turn on the Caption element, choosing N as the caption statistic:
Or you could make an computed character variable that represents the count and nest it inside of the X variable:
And in case it doesn't go without saying: you can always manually add text annotations or a custom graphics script if you need maximum flexibility.