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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
VisalSeng
Frequent Visitor

Sales by Product Combo

Hi All Member,

Currently, I'm stucked on trying to calculate total sales of Combo Product Set base on below Sales table. This sales tables don't have identify of own combo product. MasterItem column can identify it is combo but MasterItem column is base on uniqueID of transaction.

 

Example below Papa Blazing Combo, unique ID 1, So all sub combo under Papa Blazing Combo "MasterItem" are all 1 but UniqueID 12, it is also Papa Blazing Combo but MasterItem is also 12. 

 

In this case how can we caculate total sales of combo?

 

VisalSeng_0-1683953494290.png

 

Here is the result that I want to calculate.

VisalSeng_1-1683953640660.png

 

 

1 ACCEPTED SOLUTION
v-jianboli-msft
Community Support
Community Support

Hi @VisalSeng ,

 

Please try:

ComboID = 
var _a = [Masterltem]
return 
MAXX(FILTER('Table',[UniquelD]=_a),[ProductID])

Final output:

vjianbolimsft_0-1685438754295.png

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-jianboli-msft
Community Support
Community Support

Hi @VisalSeng ,

 

Please try:

ComboID = 
var _a = [Masterltem]
return 
MAXX(FILTER('Table',[UniquelD]=_a),[ProductID])

Final output:

vjianbolimsft_0-1685438754295.png

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

VisalSeng
Frequent Visitor

Thanks for your code but it seem that total sale is not follow as result yet. Result that we want is all arrange by main combo and followup by sub combo. 

I have an idea but I'm not sure how dax work yet. I want to create a new column "ComboID" as below. If we can create new column by Dax code to generate ComboID base on Product ID of Main Combo and apply to main combo and sub combo, I think we can filter and sum sales

 

VisalSeng_0-1684000607239.png

 

Mahesh0016
Super User
Super User

@VisalSeng Please Try Below Code
Product Sales =
calculate(sum('Table'[Sale]),allexcept('Table'[Product Name]))

@VisalSeng Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Happy to help!!

@Mahesh0016 It is not yet as result show. May you help to guide me as how to add as yellow colmn instead?

VisalSeng_0-1684135031774.png

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.