Forum Discussion
MCG
6 years agoHelper I
Percent within Group
Hi, i have data set showing sales of product in category: product category sales a1 a 10 a2 a 20 b1 b 30 b2 b...
kriscoupe
6 years agoSolution Supplier
Hi MCG,
You need to use the CALCULATE function to find your sales for all products in that category. This should work.
VAR ProductSales = SUM( Sales )
VAR CategorySales =
CALCULATE(
SUM( Sales ),
ALL( The table with products in ),
VALUES( Your category column )
)
RETURN
ProductSales / CategorySales
Effectively the ALL/VALUES combination removes the filters on product but then puts them back on for category.
Let me know if this helps
Kris