Getting map visualization to count entries with multiple addresses

Hi yall, had a question about map visualizations. In my database, I have a column "states_served" that includes the state(s) assigned to each client.

I'm not sure if this is the best way to code it / arrange my database, but I figured having the state info be in just one column would be best (or is there a better way to do this)?

The issue I'm running into is that the map visualization is not included clients who have multiple states assigned to them. For instance, I tried visualizing the number of the clients who are in Florida and Alabama. I used a "contains" filter to filter for clients who are in Florida or Alabama (picture 1 below).

However, the map visualization only counts the people who are in Florida only or people who are in Alabama only (picture 2 below). For instance, Alabama should have 217 + 1 + 1 + 1 + 3 + 2 + 1 = 226 clients. The map visualization only includes the 217 clients who are in Alabama only though. How might I go about fixing this. Thanks in advance :slight_smile:

Hi @datacat
Welcome to Metabase Discuss!
Can you verify if the table view returns the correct result?

Thanks for your reply!! It does return the correct result. Is there a screenshot or something you'd like me to send?

The count has to map to a single state rather than an array of states. So you should provide a result set that already has the counts per state like so:

Alabama, 226
Florida, 1468

In the table if it's split up into multiple columns (like 5 records for FL) that's ok as long as the total counts are correct in the results of the Question you're using for the map.

1 Like

That makes sense, got it to work now!! Thanks so much :slight_smile: