cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills 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
Solution Sage
Solution Sage

@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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors