This is a case that can be resolved with a many-to-many relationship:
- Build a table/view containing the unique combinations of range and sex as well as the population_segment, and a primary key column. This will be used as a fact table for the measure group containing the population_segment measure. It will also be used as a dimension table for the range-sex combination.
- Build a table/view containing age used as dimension table for age.
- Build a bridge table/view containing a foreign key to the age dimension table, as well as one to the first table. This will get the base of another measure group, which just contains count as a measure, which you probably want to make invisible.
- On the "Dimension Usage" tab, set up the relationship between the main measure group and the age dimension as a many-to-many relationship using the bridge measure group.
Once you have set up everything, all the calculation logic is handled automatically by Analysis Services.
It is a matter of usability for the users if you leave range and sex in the age dimension in addition to the range-sex dimension and make the range-sex dimension (built from the first table and linked from the bridge table) invisible, or if you keep the age in on and range in another dimension. I personally would prefer the first choice, at least for the range.