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,
DataNinja777
Super User
1 year agoHi 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,