Forum Discussion
Decomposition Tree - Categories not following
hello,
The issue you are encountering is likely due to the way you are using the ALLEXCEPT function within the CALCULATE function.
The problem is that the ALLEXCEPT function is removing all filters from the FACT_OPEN_RMA_DTL2_V table except for the ones specified in the arguments, which are the customer names in this case. This means that the SUM function inside the CALCULATE is aggregating the wholesale prices across all customers, not just the ones for the specific priority being evaluated.
To fix this issue, you need to modify the CALCULATE function to only consider the wholesale prices for the specific priority's customers. One way to achieve this is by using the FILTER function along with the ALLEXCEPT function. Here's the updated calculated column:
Priority Cust Total =
IF(
CALCULATE(
SUM(FACT_OPEN_RMA_DTL2_V[Wholesale Price]),
FILTER(
ALLEXCEPT(FACT_OPEN_RMA_DTL2_V, FACT_OPEN_RMA_DTL2_V[Customer Name]),
[Your Priority Column] = "One"
)
) >= 20000,
"One",
IF(
CALCULATE(
SUM(FACT_OPEN_RMA_DTL2_V[Wholesale Price]),
FILTER(
ALLEXCEPT(FACT_OPEN_RMA_DTL2_V, FACT_OPEN_RMA_DTL2_V[Customer Name]),
[Your Priority Column] = "Two"
)
) >= 10000,
"Two",
"Three"
)
)
In the above code, replace [Your Priority Column] with the appropriate column name that contains the priority levels for each customer. The FILTER function will restrict the wholesale price calculations to the specific priority level's customers, and then the SUM function inside the CALCULATE will give you the correct total wholesale price for each customer based on their priority level.
Hi vaibhavkale570,
Thanks for the assisstance. I was with you up until the line:
[Your Priority Column] = "One".
I'm not sure what that refers to. I tried several iterations without any luck.