Forum Discussion

SMITTY_8000408's avatar
SMITTY_8000408
Regular Visitor
9 years ago

Dynamic Pareto segmentation

Hi - Firstly if this post is answered elsewhere please let know :)

 

Example raw data:

 

Warehouse CodeWarehouse NameCustomer CodeCustomer DescriptionStock CodeSales $ USDQuantity
53WarehouseA884800CustomerAProd214.161
53WarehouseA884800CustomerAProd319.052281
53WarehouseA884800CustomerAProd517.71
53WarehouseA884800CustomerAProd67.081
53WarehouseA884800CustomerAProd77.081
53WarehouseA884800CustomerAProd810.621
53WarehouseA884800CustomerAProd917.71
53WarehouseA884800CustomerAProd12110.971921
53WarehouseA884800CustomerAProd1532.136121
53WarehouseA884800CustomerAProd1990.645241
53WarehouseA884801CustomerBProd420.121361
53WarehouseA884801CustomerBProd1891.79221
53WarehouseA884854CustomerCProd225.041961
53WarehouseA884960CustomerDProd619.632841
11WarehouseB320626CustomerEProd1640.384321
11WarehouseB365476CustomerFProd1332.136121
12WarehouseC344305CustomerGProd1440.384321
12WarehouseC370200CustomerHProd328.581961
12WarehouseC383250CustomerIProd420.928481
12WarehouseC383250CustomerIProd1056.094841
12WarehouseC383250CustomerIProd1156.413441
12WarehouseC383250CustomerIProd1754.44521
14WarehouseD315336CustomerJProd116.03621

 

I am trying to summarize my data in a sales by customer/product table like the one below. essentially a summarised 'Pareto' view of my sales data by customer and product.

 

  Products 
  AB
CustomersA7172016280
 B162805830
    
Total Sales110000 

 

I've created a summary 'Customer Code' and 'Product Code' table, and I've managed to create a dynamic set of measures that performs the A/B classification based on the running total, but at the moment I can only generate the calculations if I build them into a report view like the one below:

 

 

 

Current Measure calcs:

 

1. Sum_Sales = SUMX('YTD Quad Data Source',SUM([Sales $ USD]))

2. Rank = RANKX(ALL('Customer Code'[Cust_Code]),[Sum_Sales])

3. Running_Sales = CALCULATE([Sum_Sales],TOPN([Rank],ALL('Customer Code'[Cust_Code]),[Sum_Sales]))

4. Pareto% = DIVIDE([Running_Sales],CALCULATE([Sum_Sales],'Customer Code'[Cust_Code]))

5. CustAB = IF([Pareto%]<=0.8,"A","B")

 

My question is - Is there any way to perform these calculations and have the resulting AB ranking defined as a dimension I can group and then change dynamically based on a selected customer or product slicer?

 

Hopefully I've explained myself well enough for you all to understand the problem :)

 

Thanks in advance for your assistance

 

Craig

No RepliesBe the first to reply