I have the below CUBESET function that generates SET of LOCATION COUNTRIES (names) ordered by Quantity, which works fine. I would need the same but using multiple months. Each month that I add in the formula below is multiplying the list of members I receive. So if I add another month then I receive a list of countries as "USA,USA,GER,GER..." .I would need to receive it only once. There should be a calculation that would first sum up the Quantity for all months and then it would order all the months based on the Total Quantity per Country.
=CUBESET("Connection_to_OLAP";"
(
[Customer].[Customer No].[All].[100]
,[Date].[Calendar Year].[All].[2017]
,[Date].[Calendar Month Of Year No].[All].[01]
,{[Location].[Location Country Code].children})";"Country";1;"([Measures].[Quantity])")