Forum Discussion
Win Rate Based on Multiple Conditions
Hi everyone,
I am looking to create a win rate percentage based off multiple conditions.
I have two data sets and want to compare the product, customer, and quantity divided by the number of times the product was quoted at the specific quantity per each distinct customer. For example if milk cartons were quoted at 5 quantity for 10 customers, but only 4 of the customers bought 5 milk cartons the win rate would be 40%.
Basically the product, customer, and quantity must be matching for both the numerator and denominator.
I created a "Won" column that compares all of these yet I'm still unsure how to get it working properly.
I hope this makes sense and any help would be immensely appreciated.
7 Replies
- aj1973
Community Champion
Hi Anonymous
Can you share a sample of your model?
- AnonymousNot applicable
I'm new so I hope this is what you mean/helps.
The sales file looks something like this.
Customer Name Product Quantity
Bob Milk 1
Billy Milk 1
Kate Milk 1
Whereas the Quote File looks something like this
Customer Name Product Quantity
Bob Milk 1
Billy Milk 1
Kate Milk 1
Ted Milk 1
Tom Milk 1
Chris Milk 500
Simon Milk 5
Jim Milk 1
What I'm looking for is to match the customer, product, and quantity with each other divided by the number of times the product(milk) was quoted that also matches.
There are 6 quotes that match and 3 of them were actually purchased. Therefore, with filters, the win rate would be 50%.
- AlexisOlson
Super User
I can't quite tell for sure how you expect your example to generalize with multiple Products but my best guess is that you want something like this:
Test = VAR SalesCombinations = DISTINCT ( SELECTCOLUMNS ( Sales, "Product_Quantity", Sales[Product] & "_" & Sales[Quantity] ) ) RETURN DIVIDE ( COUNTROWS ( Sales ), COUNTROWS ( FILTER ( Quotes, Quotes[Product] & "_" & Quotes[Quantity] IN SalesCombinations ) ) )