Quantcast
Channel: Power Query topics
Viewing all articles
Browse latest Browse all 31411

Calculate Product Attach Rates via Power Query

$
0
0

First Post!

I'm trying to use power query to calculate attach rates between two products Parent and Child in my sales data for an ecommerce business.

My data is organized as traditional transaction data where a single row contains the SKU, Product ID and Line ID, plus additional order detail like qty, sales amount, and customer data.

 

Demand Order DateOrder IDOrder Line IDDemand QuantityProduct NameSKU Code
1/18/2024455916499413945762530041396 Ethernet Power Adapter - BlackYB5-000010
1/18/2024455916499413945754962541391Blue 3-Pack - BlackHG1-000500
1/26/2024456150105413945771306541392 Floor Stand - BlackYB5-000007
1/26/20244561501054139457732114741391 Table Stand - BlackYB5-000005
1/26/20244561501054139457732647141391Blue 3-Pack - BlackHG1-000500
1/30/20244562004524139457323731141391Blue 3-Pack - BlackHG1-000500

 

The output I'm hoping for is something like below - producing a list of all SKUs in the datasource, and an attach rate for each other product to that parent product.

ParentChildAttach Rate
Blue 3-Pack - Black Table Stand - Black30%
Blue 3-Pack - Black Floor Stand - Black15%
Blue 3-Pack - Black Ethernet Power Adapter - Black20%

 

I want the attach rate to be calculated at order level, not by qty of units - i.e. Count of orders containing Blue 3-Pack AND Ethernet Power Adapter, divided by count of orders containing the Blue 3-Pack would give me the attach rate of the Ethernet Adapter to the 3-Pack.


I have not used List functions in Power Query before but I'm thinking maybe this holds the solution?

 

Thanks!


Viewing all articles
Browse latest Browse all 31411

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>