I would like to create a measure for the All-Commodity Volume (ACV) indicator. The formula is the following :
Total Sales of Resellers Who Sold a Product / Total Sales of All Resellers
Let's take an example, for instance the product "LL Touring Frame - Blue, 44" from AdventureWorks2012DW Cube.
We can see it is sold by 14 resellers
These 14 resellers together make 2 706 909 $ of the sales
If I take all the resellers, they make 80 450 596 $ of the sales
My ACV measure would return 2 607 909 / 80 450 596 = 2% for the product "LL Touring Frame - Blue, 44", which means it present at the resellers who make 2% of my indirect sales.
What I'm looking for is the MDX expression which takes the "Reseller Sales Amount for all products" instead of the reseller sales amount for the selected product, but only if the "Reseller Sales Amount of the selected product is not null".
So far, thanks the help of the community I could make a query which gives me the correct result if I filter on some specific products :
WITH SET ActiveStores As NonEmpty( [DimStore].[Store].[Store] , { ([DimProduct].[Product].CurrentMember, [Measures].[Sales])} )
MEMBER ACV AS SUM(ActiveStores, [Measures].[Store Sales]) / [Measures].[Store Sales]
SELECT NON EMPTY ACV ON COLUMNS, NON EMPTY { ([DimProduct].[Product].[Product].ALLMEMBERS ) } ON ROWS FROM ( SELECT ( { [DimProduct].[Product].&[ HAMAC DE VOYAGE] } ) ON COLUMNS FROM [Cube])
This query returns an ACV of 9% for the filtered product. However, if I remove the filter by putting only FROM [Cube], the ACV becomes 100% for all the products, even the one which was 9% with the previous query.
It is like the ActiveStores set is binded with the WHERE clause but not the ROWS Axis.
Regards