def compute_cardinalities(self):
        """ This will count the number of distinct values for each dimension in
        the dataset and add that count to the model so that it can be used as a
        hint by UI components. """
        for dimension in self.model.dimensions:
            result = self.members(dimension.ref, page_size=0)
            dimension.spec['cardinality'] = result.get('total_member_count')
This will count the number of distinct values for each dimension in
        the dataset and add that count to the model so that it can be used as a
        hint by UI components.