Sort by Expression with nested ifs combined with set analysis not working
I have a solution where I have a pivot table with my clients and their revenue. The total on this table is sorted depending on what radio button is selected.
At first it looked like it was working fine, until I noticed that if a given client did have any revenue on the month selected, even if he is a top client, it's not showing in my sort. What I found out was that the client I needed in the top 10 was way down the list even though my sort is sorting by YTD.
Please see document attached for more information.
Could anyone help with this issue as I'm stuck on it for the last 3 days and I can't find anything in the community that resolves my problem.