i have the expression below but my sort using the expression
sum({$<v_Volume_in_Litres,Month=,MonthYear={'$(v_MaxMonthYear_1)'},Year=,[Account Business Cust Type]={'CPT'}>}[PYTHON Value]) + sum({$<v_Volume_in_Litres,Month=,MonthYear={'$(v_MaxMonthYear_1)'},Year=,[Account Business Cust Type]={'FLAT'},[Transaction Product Group]={'Fuel'}>}[PYTHON Value])
is always taking the largest of first expression and adding to the second expression and total is sorted based on the final total.
to illustrate further i have the example dataset attached.
i have the table with dimension limits set to top 20 and top 30 in 2 different screens. some of them marked in yellow are in 30 but not when i set to top 20. This is happening due to the value of CPT being lower but the overall total along with FLAT is higher.