'DAX RANKX keeping secret filters

I have spent hours on a RANKX problem that I simply cannot figure out.

As short as possible: I have 10 Producers which are divided into two peer groups and which I have ranked according to Sales of their Holding Companies. I have have created measures to display the Top 2 vs. the Rest. This is all working fine until I want to look at the ranking across all producers, rather than within each PeerGroup. At that point, the Top2 turns into a Top4 - it's as if the RANKX is cycling through every PeerGroup (even though the filter is set to ALL) and ranking the companies individually with each group but then displaying all 4 (top two from each group) rather than the top 2 from the total set. Does anyone have any idea how this could be resolved?

Output Measures used

EDIT: I'm convinced it has something to do with the fact that I have a separate producer lookup table that contains the PeerGroup. In a similar case, where I'm only manipulating one data table, it works perfectly.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source