This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi
I'm working on a project where I'll have to find the Number of times a Product has been upsold. For Example, If you buy a car, the sales man will pursue you to buy accesories like All Weather Mats, Roof Rail.. etc. I need to find out how many times All Weather mats are upsold with the particular Car, Like Wise for other accesories as well.
Sales Table:
| Order# | Customer# | Item# | Sales$ |
| 1 | ABC | ITM A | 100 |
| 1 | ABC | ITM B | 20 |
| 2 | BCD | ITM A | 100 |
| 2 | BCD | ITM C | 15 |
| 2 | BCD | ITM D | 20 |
| 3 | DEF | ITM X | 200 |
| 3 | DEF | ITM Y | 20 |
| 4 | FGH | ITM A | 100 |
| 4 | FGH | ITM C | 15 |
Upselling Part Detail
| Master Produt | Upsellable Product |
| ITM A | ITM B |
| ITM A | ITM C |
| ITM X | ITM Y |
Final Report Will Look SOmething Like this
Report Filter: Master Product : ITM A
Total Orders: 3
| Upsold Product | # Of Orders | % Upsold ( Total Order of ITM <> / Total Order) |
| ITM B | 1 | 1/3 = 33% |
| ITM C | 2 | 2/3 = 66% |
Any Help is much appreciated.
Thanks
Solved! Go to Solution.
@Anonymous Probably something like:
Measure =
VAR __Upsold = MAX('Table2'[Upsellable Product])
VAR __MasterProducts = DISTINCT(SELECTCOLUMNS(FILTER('Table2',[Upsellable Product]=__Upsold),"Master",[Master Product]))
VAR __Table1 = SELECTCOLUMNS(FILTER('Table1',[Item#] = __Upsold),"Order#",[Order#])
VAR __Table2 = SELECTCOLUMNS(FILTER('Table1',[Item#] IN __MasterProducts),"Order#",[Order#])
RETURN
COUNTROWS(INTERSECT(__Table1,__Table2)) / COUNTROWS(__Table1)
@Anonymous , refer
Market Basket Analysis
https://finance-bi.com/power-bi-basket-analysis/
https://businessintelligist.com/2017/03/27/market-basket-analysis-using-power-bi/
https://www.daxpatterns.com/usecases/market-basket-analysis/
https://www.mssqltips.com/sqlservertip/5428/market-basket-analysis-in-r-and-power-bi/
@Anonymous , refer
Market Basket Analysis
https://finance-bi.com/power-bi-basket-analysis/
https://businessintelligist.com/2017/03/27/market-basket-analysis-using-power-bi/
https://www.daxpatterns.com/usecases/market-basket-analysis/
https://www.mssqltips.com/sqlservertip/5428/market-basket-analysis-in-r-and-power-bi/
@Anonymous Probably something like:
Measure =
VAR __Upsold = MAX('Table2'[Upsellable Product])
VAR __MasterProducts = DISTINCT(SELECTCOLUMNS(FILTER('Table2',[Upsellable Product]=__Upsold),"Master",[Master Product]))
VAR __Table1 = SELECTCOLUMNS(FILTER('Table1',[Item#] = __Upsold),"Order#",[Order#])
VAR __Table2 = SELECTCOLUMNS(FILTER('Table1',[Item#] IN __MasterProducts),"Order#",[Order#])
RETURN
COUNTROWS(INTERSECT(__Table1,__Table2)) / COUNTROWS(__Table1)
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 9 | |
| 8 | |
| 6 | |
| 6 | |
| 6 |