Forum Discussion
Nayababbasi91
1 year agoFrequent Visitor
How to calculate sub-product quantity
Hi I would like to know how to calculate the quantity of sub-products using the table provided. Once I have the sub-product total Qty, I can create a measure to calculate % by Sub-prod...
- 1 year ago
Hi Nayababbasi91 ,
You can produce your required output by writing dax measures like below:
Sub-product (all) = calculate(sum('Table'[Brand Qty]),all('Table'[Sub-product]))Then use the measure above in another measure to calculate the % share of the total.
Sub-product quantity% = VAR Quantity= sum('Table'[Brand Qty]) return divide (Quantity,[Sub-product (all)])The resulting output looks like below:
Best regards,
Nayababbasi91
1 year agoFrequent Visitor
Thank you so much.
The only thing which isn't working is the variable:
Quantity= sum('Table'[Brand Qty])
I need to divide the total, which is 70, by each sub-product.
The sum gives the row total, not the grand total.