I have a pivot table that shows customers and their sales.
It has 3 dimensions, customer code, customer name and calendar month. The calendar month has been pivoted so it goes across the page.
I want to be able to have the user sort this table by either customer code or customer name, in either ascending or descending order. I have got a macro that works a treat for the customer code (as it is the first dimension), but I can't get it to sort by the 2nd column. I assumed this was because it was a pivot table, so I am trying to sort column 1 using an expression, but just can't get it to work.
So in the customer code sort area I have only got sort by expression ticked, and I have tried a couple of expressions (which if I add as an expression within the table it shows me the result I am after, it just wont sort on it). The one I found that looked like it should have worked was: pick(1,customerName)