Let's say we have the following data structure in SSRS report:
Disctricts are grouped by city and cities are grouped by country. And then at the country level I'd like to get SUM
of population over cities (population is an attribute of a city and districts do not have population associated with them). At the moment, when aggregation is done with =SUM(Fields!city_population.Value)
expression, population for each city is taken into account as many times as the number of districts it has associated - that is not correct.
I was thinking of getting data for summation from a supplementary dataset not having division of cities by districts (with the help of LookupSet function). But it probably won't support another grouping level of countries by year which is planned to be done further (can't figure out what can be used as a lookup key in such layout). Is there a way around this situation without lookups?
Update: It needs to be mentioned that City-District is a single entity corresponding to "city district or just the city if it has no districts". This entity was created in data source view as a named query using LEFT JOIN
(an approach discussed in this question).