Some cantons in Switzerland use a system called biproportional apportionment. They say "okay, party A got 25% of the votes, so they must get 25% of the seats. And district 1 accounts for 30% of the population, so they must get 30% of the seats." And so on. Then they do some matrix math to determine who gets what seats in which districts. The method ensures each party gets the right total number of seats while each district gets its predetermined seat count. You could in principle extend the method to handle three or more dimensions.