How do I pull the last level of a category?
.last is the opposite of .first, meaning that you can only apply it at the end of your query.

{% set markets = craft.categories.group('markets').relatedTo(entries).last() %}


And similar to .first, the .last method will only return a single Entry.