Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

DAX Challenge

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$
1ABCITM A100
1ABCITM B20
2BCDITM A100
2BCDITM C15
2BCDITM D20
3DEFITM X200
3DEFITM Y20
4FGHITM A100
4FGHITM C15
    

 

Upselling Part Detail

 

Master ProdutUpsellable Product
ITM AITM B
ITM AITM C
ITM XITM 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 B11/3 = 33%
ITM C22/3 = 66%
   

 

Any Help is much appreciated.

Thanks

 

2 ACCEPTED SOLUTIONS
Greg_Deckler
Community Champion
Community Champion

@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)
  

 

 

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

amitchandak
Super User
Super User
2 REPLIES 2
amitchandak
Super User
Super User

Greg_Deckler
Community Champion
Community Champion

@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)
  

 

 

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.