Forum Discussion
anil
Helper III
8 years agoCreating Range Buckets using Average per Category ID
Hi, My dataset has ID's with multiple orders. I am trying to calculate average discount across orders per ID. Avg Discount % = CALCULATE(AVERAGE(Sample[DISCOUNTPERCENT]),Sample,VALUES(Sample[...
- 8 years ago
Hi anil,
That's because the "Allexcept" cleared the context. Please try the formula below or adjust it.
Avg Discount % = CALCULATE ( AVERAGE ( Sample[DISCOUNTPERCENT] ), ALLEXCEPT ( 'Sample', Sample[ID], 'Sample'[Order Date].[Year] ) )Best Regards,
Dale
v-jiascu-msft
Microsoft Employee
8 years agoHi anil,
That's because the "Allexcept" cleared the context. Please try the formula below or adjust it.
Avg Discount % =
CALCULATE (
AVERAGE ( Sample[DISCOUNTPERCENT] ),
ALLEXCEPT ( 'Sample', Sample[ID], 'Sample'[Order Date].[Year] )
)
Best Regards,
Dale
anil
Helper III
8 years agoThank You v-jiascu-msft