Is there a way to query Marketing Cloud to show contacts who have exited a journey?
Thanks in advance.
Use a update contact activity at the end of each possible exit path and write something to a dataextension (you will create for this task) that inherits the SubscriberKey and a value (maybe the description of the path it took).Maybe you should also include a date field which sets the current timestamp when a new record is created.
When it reaches the update contact activity it inserts the SubscriberKey into the newly created dataextension with the value you defined.
You then will be able to see all contacts that have exited.
The solution outlined by Johannes will indeed work, if the contacts follow the standard route in Journey Builder. Since they need to pass the contact activity just before the exit step, their data will not be updated if you are using Exit Criteria and Goal Criteria, where contacts can exit a journey anywhere after a wait step, they will still be shown as in journey - when you look at the data.
However this is the only way of doing this within the constraints of standard functionality provided by the UI, and you can achieve your goal - but there can be another solution:
You can ask Salesforce to build a custom data view, which queries underlying tables in SFMC, showing the entries and exits of each contact, regardless of what exit it is (normal, exit criteria, goal criteria). This requires a paid engagement, but if you rely on this feature for key functionality, I will recommend this approach.