I want to create a view block with related content based on shared terms. For this I created a term reference field inside the content type and created a views where I use a contextual filter Taxonomy term - ID to fetch all nodes sharing the samen terms. I also added a contextual filter to excluded the current node using Content: ID.
This all works great, but I now want to sort the view by the number of sharing terms. So the nodes with the most shared terms should end up on top.
I found these two articles: Create a related content block which sorts the nodes of related content by how many tags they share? Sorting view results by the number of matched arguments (contextual filters)
Following these two I enabled aggregation and for testing purposes I added the taxonomy reference field and used the aggregation setting count distinct.
Doing this the number of distinct terms is count instead of counting the number of shared distinct count. What step am I missing here?